控制前台代码:
document.getElementById("<%=btnAdd.ClientID%>").disabled=true;
document.getElementById:获取括号内控件的ID
<%=btnAdd.ClientID%>:返回btnAdd的ID
disabled:设置控件可用/不可用
//按钮 document.getElementById("<%=btnAdd.ClientID%>").disabled = true; document.getElementById("<%=btnAdd.ClientID%>").value = "添加水印"; //文本框 document.getElementById("<%=TextBox1.ClientID%>").style.backgroundColor = "#E0E0E0"; //下拉框 document.getElementById("<%=DropDownList1.ClientID%>").disabled = true; document.getElementById("<%=DropDownList1.ClientID%>").style.backgroundColor = "#E0E0E0"; //标签 document.getElementById("<%=Label3.ClientID%>").innerText = ""; //链接按钮 document.getElementById("<%=lbtnLook.ClientID%>").innerText = ""; //文件上传 document.getElementById("FileUpload1").style.display = "inline"; document.getElementById("FileUpload1").click();