我正在尝试禁用aspx格式的按钮。这有效:
btnSave.Attributes.Add(
"onclick",
"this.disabled=true;this.value='Saving...';needToConfirm=false;" +
ClientScript.GetPostBackEventReference(btnSave, "").ToString());
但是表单上有两个按钮,我想禁用它们。这不起作用:
btnSave.Attributes.Add(
"onclick",
"this.disabled=true;this.value='Saving...';document.getElementById(<%=btnDelete.ClientID %>).disableneedToConfirm=false;" +
ClientScript.GetPostBackEventReference(btnSave, "").ToString());
答案 0 :(得分:0)
你在这里的btnsave-code中引用了btnDelete ..你应该把它改成 btnSave
:)
btnSave.Attributes.Add("onclick", "this.disabled=true;this.value='Saving...';document.getElementById(<%= btnDelete.ClientID %>).disableneedToConfirm=false;" + ClientScript.GetPostBackEventReference(btnSave, "").ToString());