easy one again!

J

Jorge Ribeiro

Hello

I've an asp.net page that, of course, has serveral
buttons,
text boxes and other kind of controls in it...

i need now to have them all disabled, or a lot of them,
and i'm searching for the best/elegant way to do it...

i managed to create a for cycle to iterate all the page's
form's controls
but usign page.controls.item(x) i can't find the enabled
property... only visible one...

how can i do this?!?!
how can i disable a bunch of controls using a for next
command instead of doing it one by one?!?!

best regards

JR
 
M

Marina

If all your controls are web controls (have WebControl class as a base class
somewhere in the inheritence hierarchy), you can cast it to WebControl in
your loop, and have access to the Enabled property.
 

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

No members online now.

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,189
Latest member
CryptoTaxSoftware

Latest Threads

Top