问题描述
基本上,我已经创建了一个使用一个UpdatePanel一个自定义的控制,并按照我的理解我需要使用的ScriptManagerProxy,使其工作(因为应该只有一个每页的ScriptManager,并在我的.aspx声明页)。所以,你怎么用这个小魔鬼,它只是一个补充的事:
Basically, I have created a custom control that uses an UpdatePanel, and as I understand it I need to use a ScriptManagerProxy to make it work ( since there should only be one ScriptManager per page, and is is declared in my .aspx page ).So, how do you use this beastie, is it just a matter of adding:
<asp:ScriptManagerProxy ID="ScriptManagerProxy3" runat="server">
</asp:ScriptManagerProxy>
您的控制,还是有更多的呢?
任何人都可以请张贴一个链接到一个很好的教程/例如设置?我尝试使用Google的这一点,但我没有找到什么有用的东西......
to your control, or is there more to it?Could anyone please post a link to a good tutorial/example set? I tried googling for this, but I didn't find anything useful...
推荐答案
您控制不需要的ScriptManagerProxy
工作。如果你需要添加一个服务引用,或在的ScriptReference你的控制,你只需要一个的ScriptManagerProxy
。在的ScriptManagerProxy
允许你这样做,而不必对所要承载您的控件的页的知识。当呈现页面时,的ScriptManagerProxy
控件的属性合并与主机页面上的的ScriptManager
控制。
Your control does not require a ScriptManagerProxy
to work. You would only need a ScriptManagerProxy
if you needed to add a ServiceReference or ScriptReference in your control. The ScriptManagerProxy
allows you to do this without having to have knowledge about the page that is going to host your control. When the page is rendered, the properties of the ScriptManagerProxy
controls are merged with those of the ScriptManager
control on the host page.
这篇关于你如何在自定义ASP.NET控件中使用的ScriptManagerProxy?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!