Disable controls on a page

  • Thread starter Thread starter tshad
  • Start date Start date
T

tshad

I have a page that has about 20 textboxes and dropdowns that I want to
disable until a button is pushed.

I don't want them to be hidden which I can do with <div visible=false
runat=server> or <asp:panel visible=false runat=server>. I want them to see
the whole page but just disable all the controls on the bottom 3/4 of the
page.

I could do it by just doing each control one at a time but then if I add or
take a control off the page I would need to remember to enable and disable
it at the proper time.

Thanks,

Tom
 
This code sample is actually for something very different, however, it shows
how to iterate through all your controls - - you can use enabled =
true/false as the outcome
 
David Wier said:
This code sample is actually for something very different, however, it
shows
how to iterate through all your controls - - you can use enabled =
true/false as the outcome

Which code sample?

Also, is it in the order of how is displayed on the screen? I want the
first 4 textboxes not be enabled and the rest disabled until I am ready.

Sounds like what I am looking for.

Thanks,

Tom
 
That's OK. I have a little brain fade myself at least once a day. :)

That was exactly what I was looking for.

Thanks,

Tom
 
Back
Top