Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > easy one again!

Reply
Thread Tools

easy one again!

 
 
Jorge Ribeiro
Guest
Posts: n/a
 
      10-20-2003
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
 
Reply With Quote
 
 
 
 
Marina
Guest
Posts: n/a
 
      10-20-2003
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.

"Jorge Ribeiro" <(E-Mail Removed)> wrote in message
news:043301c396fc$f91cb900$(E-Mail Removed)...
> 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



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is it reasonably easy easy to something like this with python? Bruno Desthuilliers Python 5 08-29-2007 07:40 AM
Stripping audio from qa DVD. Easy or not so easy? GJ Computer Support 1 05-23-2007 02:03 AM
CSS aligning two things on one line with one left and one right news.frontiernet.net HTML 6 04-16-2004 02:44 AM
easy to look at and easy to maintain web page menuing system. Hazzard ASP .Net 2 04-06-2004 03:51 AM



Advertisments