按钮在updatepanel中不起作用 [英] button not working in updatepanel

查看:721
本文介绍了按钮在updatepanel中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我的问题是按钮单击不适用于更新面板.如果不使用更新面板,则效果很好.我该如何解决这个问题?

我还尝试将整个工具放在更新面板中.

Hi
My problem is that the button click is not working with the update panel. Without using the update panel it works well. How can I solve the problem?

I have also tried to place whole tools inside the update panel. It didn''t help me.

推荐答案

您需要一个触发器,例如
< asp:UpdatePanel runat =服务器" ID ="UpdatePanel2" UpdateMode =始终" Visible ="false">
< Triggers>
< asp:AsyncPostBackTrigger ControlID ="button1" EventName ="Click"/>
</Triggers>
< ContentTemplate>
//您的代码
< asp:Button ID ="Button1" runat ="server" Text ="Click me" align ="center"
OnClick ="btn_Click" CssClass ="Button"/>
</ContentTemplate>
</asp:UpdatePanel>



这对我有用
You need a trigger eg
<asp:UpdatePanel runat="server" ID="UpdatePanel2" UpdateMode="Always" Visible="false">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="button1" EventName="Click" />
</Triggers>
<ContentTemplate>
//your code
<asp:Button ID="Button1" runat="server" Text="Click me" align="center"
OnClick="btn_Click" CssClass="Button" />
</ContentTemplate>
</asp:UpdatePanel>



this worked for me


这篇关于按钮在updatepanel中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆