使用JavaScript禁用服务器端按钮的提交行为是否可能?注意:我不想禁用按钮,用户将单击该按钮,但它不会提交/获取任何来自服务器的值。
场景:
<asp:Button ID="Button1" runat="server" Text="Submit" onclick="Button1_Click" OnClientClick="Check()" />
JavaScript:
function Check()
{
var res = confirm(" Are u sure whatYou have selected ")
if (res)
{
alert("yes");
}
else {
//Here I need to disable the submit behavoiur
}
}
}
}