In days of old you would have added script to the page as a result of a full postback such as this:
But this new method can break under ASP.NET AJAX. Why? Because ClientScriptManager is not a control that understands partial postbacks and partial rendering, and so script code registered with it will not be included in the page response for a partial postback.
Instead, if you wanted the button to introduce client script into the page output, you would leverage the ScriptManager:
The result is the same, but the method is slightly different. In fact, the methods of the ClientScriptManager control are now included in the ScriptManager control as static methods (RegisterStartupScript, for example). Whenever you are utilizing ASP.NET AJAX and want to work with script through partial postbacks, you must now use methods exposed by the ScriptManager control instead.
Thanks & Regards,
Arun Manglick || Tech Lead