Use Viewstate with UpdatePanel in asp.net — JavaScript , JavaScript with UpdatePanel — ASP.Net Example
ASP.Net Example-Use Viewstate with UpdatePanel in asp.net

Sunday, September 25, 2011

Use Viewstate with UpdatePanel in asp.net

ViewState Can not use with UpdatePanel in ASP.NET Because When Page is not postBack at time viewstate is Available and If  Page is PostBack at time viewstate kill (Destroy). Now New ViewState is Generate that is used by On in Update Panel What is Solution fo viewstate? Solution is that make EnableViewState="true" in UpdatePanel. Put Hidden Filed in UpdatePanel and store Value in Hidden Field. Problem is Solve. Now If You want to use JavaScript Function Then you can Register That JavaScript Function in UpdatePanel Load Event
protected void UpdatePanel1_Load(object sender, EventArgs e)
{
   // Add client-side script to call the JavaScript  function
   ScriptManager.RegisterStartupScript(this, this.GetType(),
                  Guid.NewGuid().ToString(),
                  "YourJAVASCRIPTfunctionName();", true);
}   

No comments:

Post a Comment

ASPdotNET-Example