![]() |
Choose 1 or many
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? |
Re: Choose 1 or many
"dancer" <dancer@microsoft.com> wrote in message news:%230lfU99lHHA.4848@TK2MSFTNGP05.phx.gbl... > 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/quickst...checklist.aspx I guess it will be more easy to use in your case. |
Re: Choose 1 or many
http://msconline.maconstate.edu/tuto...pnet06-04.aspx
"dancer" <dancer@microsoft.com> wrote in message news:%230lfU99lHHA.4848@TK2MSFTNGP05.phx.gbl... > 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? > |
Re: Choose 1 or many
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" <dancer@microsoft.com> wrote in message news:%230lfU99lHHA.4848@TK2MSFTNGP05.phx.gbl... > 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? > |
Re: Choose 1 or many
On May 16, 1:26 pm, "dancer" <dan...@microsoft.com> 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. |
Re: Choose 1 or many
Could you give me example code of the switch statement?
Thanks "clintonG" <nobody@nowhere.com> wrote in message news:eYSuJT$lHHA.588@TK2MSFTNGP06.phx.gbl... >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" <dancer@microsoft.com> wrote in message > news:%230lfU99lHHA.4848@TK2MSFTNGP05.phx.gbl... >> 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? >> > > |
| All times are GMT. The time now is 02:54 AM. |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.