When you try to use the normal way of Calling a JavaScript
method from Sever side in a Update Panel Postback, your JavaScript method will
never be called. Since Update Panel makes Asynchronous calls you need to use “ScriptMananger”
to register your client script from code behind instead of Page.ClientScript.
Page.ClientScript.RegisterStartupScript(this.GetType(), "Reset", "MethodName();", true);
If your registering the Script under Update Panel Postback
use the below line to register your client script.
If your registering the Script under normal Postback use the
below line to register your client script.
ScriptManager.RegisterStartupScript(updatepanelID,
updatepanelID.GetType(), "Reset",
"MethodName();", true);
Page.ClientScript.RegisterStartupScript(this.GetType(), "Reset", "MethodName();", true);
No comments:
Post a Comment