我有一个这样的按钮
<asp:Button ID="btncnclbkng" CssClass="divskyblue" runat="server" Text="CANCEL BOOKING" Enabled="false" Width="410px" OnClientClick="return checkrecord();"/>
和javascript如下
function checkrecord()
{
if (confirm("Are You Sure")) {
return true
}
else
return false;
}
如果我Enabled="false"
从按钮中删除,那么它会要求确认,但是我在启用后添加和删除 javascript 中按钮的 eneble-disable 属性,然后它不起作用。请建议我如何在 javascript 中将 onclient 单击属性添加到 asp.net 按钮