ASP.NET 更新面板仅更新一次
您好,我有一个像这样的更新面板,
<asp:UpdatePanel ID="Updatepanel1" runat="server">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="RadioButtons1" EventName="SelectedIndexChanged" />
<asp:AsyncPostBackTrigger ControlID="DropDown1" EventName="SelectedIndexChanged" />
<asp:AsyncPostBackTrigger ControlID="DropDown2" EventName="SelectedIndexChanged" />
<asp:AsyncPostBackTrigger ControlID="DropDown3" EventName="SelectedIndexChanged" />
</Triggers>
<ContentTemplate>
<asp:Label runat="server" Text="LabelToUpdate"></asp:Label>
</ContentTemplate>
</asp:UpdatePanel>
我想每次发生上述触发器之一时更新标签。
我第一次触发它时一切都工作得很好。但之后,即使我更改任何内容,也不再有更新(就像在第一次部分回发后所有 Control 的 AutoPostBack 都设置为 false,因此当我第二次更改选择时什么也不会发生) 。
非常感谢您的帮助,
谢谢
Hi I have an Update Panel like this
<asp:UpdatePanel ID="Updatepanel1" runat="server">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="RadioButtons1" EventName="SelectedIndexChanged" />
<asp:AsyncPostBackTrigger ControlID="DropDown1" EventName="SelectedIndexChanged" />
<asp:AsyncPostBackTrigger ControlID="DropDown2" EventName="SelectedIndexChanged" />
<asp:AsyncPostBackTrigger ControlID="DropDown3" EventName="SelectedIndexChanged" />
</Triggers>
<ContentTemplate>
<asp:Label runat="server" Text="LabelToUpdate"></asp:Label>
</ContentTemplate>
</asp:UpdatePanel>
I want to update the label everytime one of the above triggers happens.
The first time I trigger it everything works perfectly fine. But after that there are no more updates even if I change anything (It is like all Control's AutoPostBack
get set to false after the first Partial Post back, so nothing happens when i change the selection a second time).
Any help is greatly appreciated
Thank you
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
复制并粘贴这个..效果很好:)
Copy and Paste this .. works fine :)