jQuery的Asp.net按钮关闭 [英] Jquery Asp.net button disable
本文介绍了jQuery的Asp.net按钮关闭的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
HTML code:
html code:
<asp:Button runat="server" ID="btnTest" Text="Test" OnClick="btnTest_Click" />
jQuery的code:
Jquery Code:
$('[id$=btnTest]').click(function(){
$('[id$=btnTest]').attr('disabled', 'true');
});
codeBehind:
CodeBehind:
protected void btnTest_Click(object sender, EventArgs e)
{
//here not come.
}
code为btnTest事件背后不行?
Code Behind btnTest event not work ?
推荐答案
我觉得使得Click事件处理程序禁用了按钮的preventing回发。尝试一段时间后执行禁用code:
I think that making the button disabled in the click event handler is preventing the postback. Try executing the disabling code after some time:
$('[id$=btnTest]').click(function(){
var button = this;
setTimeout(function() {
$(button).attr('disabled', 'disabled');
}, 100);
});
这篇关于jQuery的Asp.net按钮关闭的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文