Programatically prevent ASP .NET AJAX scripts from rendering

Posted by cbp on Stack Overflow See other posts from Stack Overflow or by cbp
Published on 2009-03-11T05:28:39Z Indexed on 2010/05/09 5:18 UTC
Read the original article Hit count: 259

Filed under:
|
|
|

Does anyone know of a way that I can stop all the .NET AJAX scripts from rendering, even if a ScriptManager exists on the page?

The ScriptManager's Visible property has been overridden and disabled so that you receive a NotImplementedException if you try to set the Visible property.

The reason I would like to do this is that I don't want these large chunks of javascript all over my pages when they are not required. The ScriptManager needs to be included on the master page to ensure that only one ScriptManager is added, but it would be stupid to to have to have two versions of the same master page - one ajax enabled and one not.

Edit: I am actually using Telerik's RadScriptManager with RadAjax, in case anyone knows a method using these classes instead.

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about AJAX