Referencing Checkboxlist values

T

tjonsek

I am wanting to iterate through a checkboxlist and for those the user
has selected, perform certain actions. So far, I'm not successful. I
always catch the first selected value, but anything after that is not
regarded. Here is a snippet of the code:
Dim I As Integer
For I = 0 To CheckBoxList1.Items.Count - 1
If CheckBoxList1.Items(I).Selected Then
Select Case CheckBoxList1.Items(I).Text
'**********I check each case for the selected value and do
something if selected**********
End Select
End If


Next

I have also tried evaluating the following in my select case statement,
in place of 'CheckBoxList1.Items(I).Text' :

CheckBoxList1.Items(I).Selected.ToString
CheckboxList1.SelectedValue

Thanks for any help.
TJ
 
P

Patrick.O.Ige

TJ
Are you sure you are wrapping your CheckBoxList in
If Not Page.IsPostBack Then
'Ur Checkboxlist here
End if
Patrick
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,074
Latest member
StanleyFra

Latest Threads

Top