I'm trying to loop trough a bunch of checkboxes that start with a specific id.
This bit of code seems normal, but it doesn't find anything :
Dim childc As Control
Dim c as Control
For Each c In Me.Page.Controls
For Each childc In c.Controls
If TypeOf childc Is CheckBox Then
If CType(childc, CheckBox).Checked Then
If childc.ID.StartsWith("ctl00_indexBody_ID_ACTIVITE_") Then
i = i + 1
Alerte(CType(childc, CheckBox).Text)
strSQL = "INSERT INTO A_ACTIVITES VALUES("
strSQL += Me.ID_PRESTATAIRE.Text + "," + childc.ID + ","
strSQL += ")"
oWebConnection.Execute(strSQL)
End If
End If
End If
Next
Next
it breacks in the second line saying that
it's impossible to cast an objet of type 'ASP.masterpage_master' to 'System.Web.UI.WebControls.CheckBox
Thank's for your help