我有带有一些文本字段的模式对话框。在父窗口中,我有一个中继器,如果单击中继器的 item_command,则模式对话框的文本字段中输入的数据将被清除。回发事件会清除对话框中的数据。所有这些都在同一个更新面板内。我尝试将两者放在不同的更新面板中,但没有成功。我该如何解决这个问题?
最佳答案
对转发器和模式对话框使用两个不同的更新面板。还将对话框的更新面板的 UpdateMode 设置为 Conditional,并为同一更新面板使用 AsyncPostBackTrigger 例如。
<asp:UpdatePanel ID="UpdatePanel2" runat="server">
<ContentTemplate>
.....Repeater Control goes here........
</ContentTemplate>
</asp:UpdatePanel>
........other html goes here........
<asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div id="divadvance" runat="server">
<asp:TextBox ID="txtAmount" runat="server" Style="width: 85%;"></asp:TextBox>
<input type="button" runat="server" id="btSearch" />
</div>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="btSearch" EventName="ServerClick" />
</Triggers>
</asp:UpdatePanel>
关于javascript - VB.NET 数据从父窗口回发的模式弹出窗口中清除,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45157873/