简体   繁体   English

从母版页或内容页仅加载一次ScriptManager

[英]Loading ScriptManager only once either from Master page or Content page

I have an web application of 200 web pages and all has a single master page. 我有一个包含200个网页的Web应用程序,并且全部都有一个母版页。 Most of the content pages use AJAX controls so most of content pages has its own ScriptManager. 大多数内容页面使用AJAX控件,因此大多数内容页面都有其自己的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. 现在,我需要添加一个带有HoverMenuExtender控件的链接, 为此 ,我需要将ScriptManager放在“母版”页面中,但是它仅在没有ScriptManager的内容页面中起作用。

All the other content pages which has ScriptManager throws the error Only one instance of a ScriptManager can be added to the page . 具有ScriptManager的所有其他内容页面都将引发错误。 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. 我不想再次在大多数内容页面上删除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. 有什么简单的方法可以做到这一点,例如在“母版页”中进行编码,它可以确定是否已经有ScriptManager,然后再不加载它。

Take a look at ScriptManagerProxy . 看一下ScriptManagerProxy This is what I think you need. 这就是我认为您需要的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM