How to call jQuery code only before the ASP.NET postback

Unknown | 10:39 PM |

"PostBack is the name given to the process of submitting an ASP.NET page to the server for processing ."



protected void Page_Load(object sender, EventArgs e)
{
   if (IsPostBack)
   {
        ClientScript.RegisterHiddenField("hdnPostBack", "1");
   }
 }




$(document).ready(function () {

    var isPostBackOccured = document.getElementById('hdnPostBack');
    if (isPostBackOccured== null) alert('Page is called first Time');
    else alert('Page is called after Postback');
});

Category:

About http://dotnetvisual.blogspot.in/:
DOT NET TO ASP.NET is a web application framework marketed by Microsoft that programmers can use to build dynamic web sites, web applications and web services. It is part of Microsoft's .NET platform and is the successor to Microsoft's Active Server Pages (ASP) technology. ASP.NET is built on the Common Language Runtime, allowing programmers to write ASP.NET code using any Microsoft .NET language. create an application very easily ....