如何使用AJAX在母版页时,内容页面的ScriptManager? [英] How to use AJAX in master page when content pages have ScriptManager?

查看:130
本文介绍了如何使用AJAX在母版页时,内容页面的ScriptManager?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的ASP.NET 3.5项目中,大部分内容页面的ScriptManager控制,但母版页没有。我现在想在母版页使用的UpdatePanel但它不允许把其他的ScriptManager。

In my ASP.NET 3.5 project, most content pages have ScriptManager control but the Master Page does not have. I now want to use UpdatePanel in the master page but it is not permitting to put another ScriptManager.

我可以在内容页面的变化需要被复制到各地的五十页不会更改的ScriptManagerProxy。

I cannot change to ScriptManagerProxy in content pages as the change needs to be replicated to around fifty pages.

有什么方法中可以共享内容页的ScriptManager的使用的UpdatePanel在母版页或其他什么东西?

Is there any way to use UpdatePanel in Master Page by either sharing content page's ScriptManager or something else?

推荐答案

三种方式,我能想到。

第一种方法是使用代替的ScriptManager 中的ContentPlaceHolder里面,上也有其他页面的ScriptManager 此将覆盖在要存在的,只是没有使用这个的ContentPlaceHolder,如果这是可能的。

First way is to use place the ScriptManager inside the ContentPlaceHolder, on the other pages that also have ScriptManager this will be overwrite, in the one that you want to exist, just not use this ContentPlaceHolder, if this is possible.

<asp:ContentPlaceHolder ID="PlaceHolderID" runat="server" >
    <asp:ScriptManager ID="ScrMang" runat="server" >
    </asp:ScriptManager>
</asp:ContentPlaceHolder>

第二种方法是让第二个母版页,来自第一,并使用带的ScriptManager和所有其余的第二个母版页,如果这是可能的。

Second way is to make a second master page, come from the first, and use this second master page with ScriptManager and all the rest, if this is possible.

而在去年,改变所有50页,移动的ScriptManager 来的母版页,从休息中删除。有的时候我们做到这一点:)

And last, change all 50 pages, move the ScriptManager to master page, remove it from the rest. Some time we do that :)

这篇关于如何使用AJAX在母版页时,内容页面的ScriptManager?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆