Looping through checkboxes

A

Amy Snyder

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
 
S

Suresh

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).

http://msdn.microsoft.com/library/default.asp?
url=/library/en-
us/cpref/html/frlrfsystemwebuiwebcontrolscheckboxlistclasst
opic.asp

Suresh.
 
A

Amy Snyder

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

thank you
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,062
Latest member
OrderKetozenseACV

Latest Threads

Top