Checking if any item in a radio list is checked

Discussion in 'ASP .Net' started by Darrel, Apr 21, 2009.

  1. Darrel

    Darrel Guest

    Is there a one-line way to check to see if there is an item in a radiobutton
    list that is checked? Or does one need to test each radiobutton in the list?
    I assume one can do the former, but I'm at a loss for the syntax.

    -Darrel
     
    Darrel, Apr 21, 2009
    #1
    1. Advertising

  2. Radiobutton? Sure, only one of a group is ever "checked". Checklist? Yes,
    but it can be dangerous if the list can change. The rendered id stays the
    same after the control is rendered, as long as you do not change conditions,
    number of items or placement (place it in a control, for example).

    --
    Gregory A. Beamer
    MCP: +I, SE, SD, DBA

    *********************************************
    | Think outside the box!
    |
    *********************************************
    "Darrel" <> wrote in message
    news:...
    > Is there a one-line way to check to see if there is an item in a
    > radiobutton list that is checked? Or does one need to test each
    > radiobutton in the list? I assume one can do the former, but I'm at a loss
    > for the syntax.
    >
    > -Darrel
    >
     
    Cowboy \(Gregory A. Beamer\), Apr 22, 2009
    #2
    1. Advertising

  3. Darrel

    Darrel Guest

    > Radiobutton? Sure, only one of a group is ever "checked". Checklist? Yes,
    > but it can be dangerous if the list can change. The rendered id stays the
    > same after the control is rendered, as long as you do not change
    > conditions, number of items or placement (place it in a control, for
    > example).


    Well, I ended up doing a for loop to loop through each item in the
    radiobuttonlist to check that at least one of the items was actually
    checked.

    Not a huge deal, but I would have thought there'd have been a built in
    property one could check.

    -Darrel
     
    Darrel, Apr 27, 2009
    #3
    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. hy
    Replies:
    0
    Views:
    406
  2. yurps
    Replies:
    1
    Views:
    6,923
    rajeshthangarasu1983
    Feb 29, 2008
  3. Carlos
    Replies:
    1
    Views:
    887
    Jc Morin
    Feb 24, 2005
  4. RisingFish
    Replies:
    0
    Views:
    385
    RisingFish
    Oct 10, 2006
  5. Hiten
    Replies:
    1
    Views:
    663
    Vidar Petursson
    May 26, 2004
Loading...

Share This Page