简体   繁体   中英

How do you use ScriptManagerProxy in a custom ASP.NET control?

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>

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...

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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