asp.net 后台方法
//遍历页面所有button控件
for (int i = 0; i < this.form1.Controls.Count; i++)
{
if (this.form1.Controls[i].GetType().ToString() == "System.Web.UI.WebControls.Button")
{
Button buttonHander = this.form1.Controls[i] as System.Web.UI.WebControls.Button;//得到button
buttonHander.Enabled = false;
}
}
//遍历页面所有button控件
for (int i = 0; i < this.form1.Controls.Count; i++)
{
if (this.form1.Controls[i].GetType().ToString() == "System.Web.UI.WebControls.Button")
{
Button buttonHander = this.form1.Controls[i] as System.Web.UI.WebControls.Button;//得到button
buttonHander.Enabled = false;
}
}
--jquery 前台方法--
//所有按钮置位为可用状态 (这里是所有控件,可以指定为button$("input").attr("disabled", false);
//所有按钮置位为不可用状态
$("input").attr("disabled", false);