Choose 1 or many

Discussion in 'ASP .Net' started by dancer, May 16, 2007.

  1. dancer

    dancer Guest

    I'm using ASP.Net and VB.net

    I have 18 choices - 18 checkboxes. The user can choose 1, a few, or all.
    What is the best structure to record and write the response? Select/Case
    statement? Or is that only for ONE choice?
     
    dancer, May 16, 2007
    #1
    1. Advertising

  2. "dancer" <> wrote in message
    news:%...
    > I'm using ASP.Net and VB.net
    >
    > I have 18 choices - 18 checkboxes. The user can choose 1, a few, or all.
    > What is the best structure to record and write the response? Select/Case
    > statement? Or is that only for ONE choice?


    What about the CheckBoxList Control?
    http://samples.gotdotnet.com/quicks...rlref/webctrl/checkboxlist/doc_checklist.aspx

    I guess it will be more easy to use in your case.
     
    Alexey Smirnov, May 16, 2007
    #2
    1. Advertising

  3. Jon Paal [MSMD], May 16, 2007
    #3
  4. dancer

    clintonG Guest

    I prefer a hybrid solution which I have found useful. The outer statement
    will often use a single if branching logic statement to determine if any
    selections have been made. Within the if statement block I then use the
    switch statement as each successive case can be passed conditional logic and
    is easier to read, modify and maintain than continuing to nest if branching
    logic statements.

    <%= Clinton Gallagher
    NET csgallagher AT metromilwaukee.com
    URL http://clintongallagher.metromilwaukee.com/



    "dancer" <> wrote in message
    news:%...
    > I'm using ASP.Net and VB.net
    >
    > I have 18 choices - 18 checkboxes. The user can choose 1, a few, or all.
    > What is the best structure to record and write the response? Select/Case
    > statement? Or is that only for ONE choice?
    >
     
    clintonG, May 16, 2007
    #4
  5. dancer

    Guest

    On May 16, 1:26 pm, "dancer" <> wrote:
    > I'm using ASP.Net and VB.net
    >
    > I have 18 choices - 18 checkboxes. The user can choose 1, a few, or all.
    > What is the best structure to record and write the response? Select/Case
    > statement? Or is that only for ONE choice?


    use one event handler for all checkboxes, check the sender - checkbox
    control - TagName property. Make sure you set the TagName property for
    each check box to unique id. Use that id as key to store the check/
    unchecked boolean value in hash table or any other collection.
     
    , May 16, 2007
    #5
  6. dancer

    dancer Guest

    Could you give me example code of the switch statement?
    Thanks


    "clintonG" <> wrote in message
    news:eYSuJT$...
    >I prefer a hybrid solution which I have found useful. The outer statement
    >will often use a single if branching logic statement to determine if any
    >selections have been made. Within the if statement block I then use the
    >switch statement as each successive case can be passed conditional logic
    >and is easier to read, modify and maintain than continuing to nest if
    >branching logic statements.
    >
    > <%= Clinton Gallagher
    > NET csgallagher AT metromilwaukee.com
    > URL http://clintongallagher.metromilwaukee.com/
    >
    >
    >
    > "dancer" <> wrote in message
    > news:%...
    >> I'm using ASP.Net and VB.net
    >>
    >> I have 18 choices - 18 checkboxes. The user can choose 1, a few, or all.
    >> What is the best structure to record and write the response? Select/Case
    >> statement? Or is that only for ONE choice?
    >>

    >
    >
     
    dancer, May 18, 2007
    #6
    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. Marco Ippolito
    Replies:
    0
    Views:
    2,611
    Marco Ippolito
    Oct 11, 2004
  2. arieljake
    Replies:
    3
    Views:
    352
    arieljake
    Feb 9, 2005
  3. Johan
    Replies:
    15
    Views:
    888
    Johan
    Feb 27, 2004
  4. Print Dude
    Replies:
    14
    Views:
    544
    Chris Smith
    Feb 10, 2007
  5. amith
    Replies:
    5
    Views:
    161
    Thomas 'PointedEars' Lahn
    Nov 28, 2003
Loading...

Share This Page