Looping through checkboxes

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Amy Snyder

    Looping through checkboxes

    This is my firt .NET project so please bear with me.

    I have a form of checkboxes and all I want to do is loop through them
    all after the page has been submitted and have their values added to a
    string. This was pretty simple using classic ASP but I can't seem to do
    it using .NET.

    I thought it was as simple as iterating through Page.Controls, but it is
    not. Can anyone provide code (VB script) to help


    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
  • Suresh

    #2
    Looping through checkboxes

    Are you using a CheckBoxList control or seperate check
    boxes in different areas in the form?

    If your checkboxes can be grouped together you should use
    the CheckBoxList object. It's very easy to loop thru them.

    Here's some more details on the control(watch the line
    wraps).


    url=/library/en-
    us/cpref/html/frlrfsystemwebu iwebcontrolsche ckboxlistclasst
    opic.asp

    Suresh.
    [color=blue]
    >-----Original Message-----
    >This is my firt .NET project so please bear with me.
    >
    >I have a form of checkboxes and all I want to do is loop[/color]
    through them[color=blue]
    >all after the page has been submitted and have their[/color]
    values added to a[color=blue]
    >string. This was pretty simple using classic ASP but I[/color]
    can't seem to do[color=blue]
    >it using .NET.
    >
    >I thought it was as simple as iterating through[/color]
    Page.Controls, but it is[color=blue]
    >not. Can anyone provide code (VB script) to help
    >
    >
    >*** Sent via Developersdex http://www.developersdex.com[/color]
    ***[color=blue]
    >Don't just participate in USENET...get rewarded for it!
    >.
    >[/color]

    Comment

    • Amy Snyder

      #3
      Re: Looping through checkboxes


      I am not using the List control. Can you provide VB sytnax to walk the
      tree to get all the checkboxes?

      thank you


      *** Sent via Developersdex http://www.developersdex.com ***
      Don't just participate in USENET...get rewarded for it!

      Comment

      Working...