如果有 UpdatePanel
在另一个 UpdatePanel
,并且在内部的UpdatePanel 中有一个按钮,我想点击这个按钮时,只刷新内部UpdatePanel
.如何 ?
最佳答案
在innerupdate 面板中将updatemode 设置为conditional,并将outerupdatepanel childrenastriggers 属性设置为false。在内部更新面板中添加一个 postbacktrigger 并将其设置为将导致回发的按钮。像这样的东西
<asp:UpdatePanel ID="parentup" runat="server" ChildrenAsTriggers="false">
<ContentTemplate>
<asp:UpdatePanel ID="chidlup" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<asp:Button ID="btn" runat="server" />
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="btn" />
</Triggers>
</asp:UpdatePanel>
</ContentTemplate>
</asp:UpdatePanel>
关于asp.net - 仅刷新另一个 UpdatePanel 内的 UpdatePanel,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11843912/