Getting Checkboxes

  • 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 Ruslan,

I asume it is a webpage, the trick is that "me.findcontrol("form1")"
and then for each ctl in "frm.controls", that is nowhere in the
documentation.

It is with textboxes

\\\
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim frm As Control = Me.FindControl("Form1")
Dim ctl As Control
For Each ctl In frm.Controls
Dim tb As TextBox
If TypeOf ctl Is TextBox Then
tb = DirectCast(ctl, TextBox)
tb.Text = String.Empty
End If
Next
///


I hope this helps a little bit?
 
Back
Top