views:

138

answers:

1

When should I use ScriptManager to register scripts and when is it ok to use the Page.ClientScript? What are the rules?

+1  A: 

The intention is for ScriptManager to be used with ASP.NET AJAX-specific scripts, since it is supposed to ensure things are placed in the right order with the right dependencies pre-registered for ASP.NET AJAX controls and scripts to work properly.

The ClientScriptManager (Page.ClientScript) is for JavaScripts in general, e.g. anything that is not directly tied to ASP.NET AJAX.

(Per MSDN: http://msdn.microsoft.com/en-us/library/system.web.ui.scriptmanager.aspx, http://msdn.microsoft.com/en-us/library/system.web.ui.clientscriptmanager.aspx)

Rex M