Controls on ASPX page

  • Thread starter Thread starter Ruslan Shlain
  • Start date Start date
R

Ruslan Shlain

I have a page where I dynamically create checkboxes. When the time comes I
need to know if any of them checked and if they are check I need to update
DB to reflect the changes on the page.
I know the ID's of checkboxes than are on the page but I can not capture
them in any way. I tried looping thought the Controls collection with
different way to capture the checkbox control but no success. Please
help!!!!!!!!
 
hi there,

if you are using a checkboxlist control, you can use some code like this:

Dim cItem As ListItem

For Each cItem In checkboxList.Items

If cItem.Selected = True Then

.....perform your action here.

End If

Next

cItem = Nothing

regards,
Paul.
 
If you are dynamically creating the checkboxes then you
have to create them again during postback.

Their state will be saved in the viewstate.

HTH,
Suresh.
 

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

Back
Top