Thursday, July 10, 2008

Register ClientScript

When javascript needs to be registered dynamically based on certain conditions we use page methods like Page.ClientScript.RegisterClientScriptBlock etc.
In case we have an update panel and we need to register a script on partial postback it should be done through script manager. So the code would be.

ScriptManager.RegisterClientScriptBlock(Control, Type, String, String, Boolean)
ScriptManager.RegisterClientScriptBlock(control, Type, key, script, add script tags or not);

A useful blog

No comments: