html代码:
<asp:Button runat="server" ID="btnTest" Text="Test" OnClick="btnTest_Click" />
J查询代码:
$('[id$=btnTest]').click(function(){
$('[id$=btnTest]').attr('disabled', 'true');
});
代码隐藏:
protected void btnTest_Click(object sender, EventArgs e)
{
//here not come.
}
btnTest 事件背后的代码不起作用?
最佳答案
我认为在点击事件处理程序中禁用按钮会阻止回发。一段时间后尝试执行禁用代码:
$('[id$=btnTest]').click(function(){
var button = this;
setTimeout(function() {
$(button).attr('disabled', 'disabled');
}, 100);
});
关于asp.net - Jquery Asp.net 按钮禁用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2905668/