easy one again!

Discussion in 'ASP .Net' started by Jorge Ribeiro, Oct 20, 2003.

  1. 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
     
    Jorge Ribeiro, Oct 20, 2003
    #1
    1. Advertising

  2. Jorge Ribeiro

    Marina Guest

    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" <> wrote in message
    news:043301c396fc$f91cb900$...
    > 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
     
    Marina, Oct 20, 2003
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Hazzard
    Replies:
    2
    Views:
    679
    Hazzard
    Apr 6, 2004
  2. amit
    Replies:
    0
    Views:
    413
  3. che
    Replies:
    2
    Views:
    524
  4. abcd

    Importing again and again

    abcd, Jun 8, 2006, in forum: Python
    Replies:
    9
    Views:
    342
    Maric Michaud
    Jun 9, 2006
  5. Bruno Desthuilliers
    Replies:
    5
    Views:
    414
    Bruno Desthuilliers
    Aug 29, 2007
Loading...

Share This Page