如何禁用按钮asp.net [英] how do I disable Button asp.net
本文介绍了如何禁用按钮asp.net的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我如何禁用或启用asp.net按钮?我想点击prevent双击后关闭按钮。我想点击它后禁用我的登录按钮。
How can I disable or enable button in asp.net? I want to disable button after click to prevent double click. I am trying to disable my Login button after clicking on it.
推荐答案
您需要禁用它的客户端,使用户无法再次点击它。
You have to disable it on client so that user could not click it again.
<asp:button id="btn" runat="server" OnClientClick="this.disabled=true;"......
要禁用服务器端asp.net code。
To disable on server side asp.net code.
btn.Enabled = false;
这篇关于如何禁用按钮asp.net的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文