Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   Choose 1 or many (http://www.velocityreviews.com/forums/t507011-choose-1-or-many.html)

dancer 05-16-2007 05:26 PM

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?



Alexey Smirnov 05-16-2007 06:24 PM

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.



Jon Paal [MSMD] 05-16-2007 06:25 PM

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?
>




clintonG 05-16-2007 07:59 PM

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?
>




hussain.saleem@gmail.com 05-16-2007 10:05 PM

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.


dancer 05-18-2007 01:26 PM

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.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57