用_dopostback禁用控件 [英] disable the control with _dopostback
本文介绍了用_dopostback禁用控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何使用javascript使用_dopostback禁用控件,
任何人都可以告诉我如何在单击页面
how to disable the control with _dopostback using javascript,
Can any one tell me how to disable the button while i click the button in page
推荐答案
使用此代码 onClientClick
Use this code onClientClick
<script language="Javascript">
function disabledME()
{
document.getElementById("btnID").disabled = true;
return false;
}
</script>
<asp:button id="btnID" text="ClickMe" runat="server" onclientclick="return disabledME();" xmlns:asp="#unknown" />
本文介绍了这种情况非常精美-在回发期间禁用按钮控件. [禁用点击按钮 [ ^ ]
希望对您有所帮助!
This article explains this scenario very beautifully - Disable a button control during postback.[^]
Dave Ward (author of above article) has replied to the same question here - Disable a button on click[^]
Hope this helps!
如果您要在单击并发起回发后禁用该按钮,则该按钮将无法正常工作,该页面已经被处理.如果要在回发后禁用它,则在代码隐藏区中设置控件的Enabled属性.如果要在回发之前禁用它,请使用
If you want to disable the button after you have clicked and initiated a postback then it won''t work, the page is already being processed. If you want to disable it after the postback then in the code-behind set the controls Enabled property. If you want to disable it before postback then use
这篇关于用_dopostback禁用控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文