Monday, April 19, 2010

call javascript function every time when the page load

//call javascript function every time when the page load
//include the partial page post back

ScriptManager sm = ScriptManager.GetCurrent(Page);
if (sm.IsInAsyncPostBack)
{
Page.ClientScript.RegisterStartupScript(this.GetType(), "anotherKey", "CheckingCostDiv();", true);
}
else
{
Page.ClientScript.RegisterStartupScript(this.GetType(), "anotherKey", "Sys.Application.add_load(CheckingCostDiv);", true);
}

No comments: