Programatically prevent ASP .NET AJAX scripts from rendering
- by cbp
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.