C
Cerebrus99
Hi Js,
Instead of declaring myControl as Control, try declaring it as WebControl
(System.Web.UI.WebControls.WebControl). This class possesses the "Enabled"
property. This of course, assumes that you have only WebControls on your
page, and not HtmlControls etc. Also, not all WebControls support this
property, so you would have to be careful about what all you have on the
page. An alternative may be to put all the controls you want to disable,
into a Panel control and then use "For each myControl in Panel1.Controls"..
The code would then be :
------------------------
Dim myControl as WebControl
For each myControl in Page.Controls
myControl.Enabled = False
Next
------------------------
Hope this helps...
Regards,
Cerebrus.
Instead of declaring myControl as Control, try declaring it as WebControl
(System.Web.UI.WebControls.WebControl). This class possesses the "Enabled"
property. This of course, assumes that you have only WebControls on your
page, and not HtmlControls etc. Also, not all WebControls support this
property, so you would have to be careful about what all you have on the
page. An alternative may be to put all the controls you want to disable,
into a Panel control and then use "For each myControl in Panel1.Controls"..
The code would then be :
------------------------
Dim myControl as WebControl
For each myControl in Page.Controls
myControl.Enabled = False
Next
------------------------
Hope this helps...
Regards,
Cerebrus.