enable all controls in a web form (1.1)

  • Thread starter Thread starter Chattanooga
  • Start date Start date
C

Chattanooga

hi all,

is there a way to enable all controls in a web form?
something like

for each control in page.controls
control.enabled = true
next

i tried the one above, but that did not give me the .enabled
property...

TIA,
Chris
 
Page.Controls is a collection of System.Web.UI.Control items. There is no
property Enabled for this type. You can typecast the items to
System.Web.UI.WebControls.WebControl which is the base class for all web
controls. This class does have Enabled property. Of cause, you should make
sure that the controls on the page are indeed WebControls.

Eliyahu
 
Back
Top