enable all controls in a web form (1.1)

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
 
E

Eliyahu Goldin

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,154
Members
46,702
Latest member
LukasConde

Latest Threads

Top