Javascript Ispostback Method :
Normally we use IsPostback method in the server side to check for postback. But there may be some situations where we really need this on clientside.
So lets see how to do this
// Client side postback Identification
function IsPostBack() {
return < %= IsPostBack.ToString().ToLower() % >;
}
The above method will return the boolean value indicating whether it is a postback or not. we can use like below
if(!IsPostBack())
{
// To do
}
else
{
// To do
}
So Checking for postback in clientside javacript is possible.
2 comments:
You are real lion
When and where this script will run? on client side??
Post a Comment