Peanut
Peanut

Reputation: 19407

ASP.NET Ajax script registration

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

Upvotes: 0

Views: 408

Answers (1)

Rex M
Rex M

Reputation: 144112

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)

Upvotes: 1

Related Questions