E
Evan M.
Hello
I'm trying to disable all the WebControls in my form under condition
(i.e. data is missing). So I'm trying the following lines:
foreach (System.Web.UI.WebControls.WebControl c in
EditingForm.Controls)
c.Enabled = false;
However, when I try and hit the page, I get this exception:
System.InvalidCastException: Specified cast is not valid.
So if this refuses to work, who can tell me how I can disable all the
web controls on my page without having to explicitly hit each one?
I'm trying to disable all the WebControls in my form under condition
(i.e. data is missing). So I'm trying the following lines:
foreach (System.Web.UI.WebControls.WebControl c in
EditingForm.Controls)
c.Enabled = false;
However, when I try and hit the page, I get this exception:
System.InvalidCastException: Specified cast is not valid.
So if this refuses to work, who can tell me how I can disable all the
web controls on my page without having to explicitly hit each one?