再问一次关于一次性将所有同一控件全都disabled掉的问题。
早上yxrj()的方法如下,解决了将所有TextBox disabled掉的问题:
foreach(Control mycontrol in Page.Controls[1].Controls)
{
try
{
((TextBox)mycontrol).Enabled=false;
}
catch
{
}
}
现在我想在try{}里加入:
((DropDownList)mycontrol).Enabled=false;
((HtmlInputRadioButton)mycontrol).Disabled=true;
把DropDownList和HtmlInputRadioButton也disabled掉。可是不成功。
不知道为什么..
谢谢,请再帮我解释一下吧.