Is there a simple way to determine if there is a control on a page that requires a scriptmanager? I am adding a scriptmanager to every page (which works great) in my page init, but it seems like there would be a better way than just forcing every page to have a scriptmanager. Maybe 1 in 4 pages have update panels, or some sort of extender. Or is it not much of an extra load and just not worry about it?
Share
Use inheritance to your advantage. Create some sort of
ScriptManagerPageBaseclass whosePageInitmethod invokes a newScriptManager. For every page that requires yourScriptManager, such as usingUpdatePanelcontrol, simply have that page inherit fromScriptManagerPageBaseand you’ll get that functionality only when you need it, without having to duplicate code.