views:

30

answers:

1

I have an web application of 200 web pages and all has a single master page. Most of the content pages use AJAX controls so most of content pages has its own ScriptManager. Now I have a requirement to add a link with HoverMenuExtender control and for that I need to put ScriptManager in the Master page, but it is working only in the content pages where there is not ScriptManager.

All the other content pages which has ScriptManager throws the error Only one instance of a ScriptManager can be added to the page. I don't want to work on most of the content pages again to remove ScriptManager.

Is there any easy way to do this something like coding in Master page which decides if there is already ScriptManager already, then don't load it.

A: 

Take a look at ScriptManagerProxy. This is what I think you need.

m.edmondson
But it is the other way around. rite? i.e. SM is already added in parent and avoiding it in child. I am trying to get the reverse.
Antoops
As far as I know the only way would be to move all the individual ScriptManagers from the content pages and replace them with ScriptManagerProxys. Then you can have a single ScriptManager on the master page. The ScriptManagerProxy is specifically defined as "Enabling nested components such as content pages" so that gives the impression the way your app is set up is possibly wrong. I'm very much interested in others comments however this is how I've dealt with it in the past.
m.edmondson