At runtime I build a table containing a number of checkboxes with captions from a db table. They appear on the page as expected.
Dim CourseRow As New TableRow
...
Dim chk As New CheckBox
chk.CssClass = CourseCssClass
chk.ID = Course.Course
chk.Text = Course.Course & "<br />"
Dim CourseCell As New TableCell
CourseCell.Controls.Add(chk)
CourseCell.Width = colWidth
CourseRow.Cells.Add(CourseCell)
...
this gives me:
<input id="dnn_ctr373_View_Course1" type="checkbox" name="dnn:ctr373:View:Course1" />
<label for="dnn_ctr373_View_Course1">Course1<br /></label>
My problem is that I am unable to find them on submit to see if they have been checked. I have tried variations on listing the controls and
Dim chk As CheckBox
chk = CType(FindControl("dnn_ctr_View_Course1"), CheckBox)
but am unable to find what I need. I know I must be missing something simple:(
A second question: Is there an easy way of finding what id DNN will append to the control. I assigned Control1 but DNN prepended this with "dnn_ctr_View_" giving me "dnn_ctr_View_Course1"
Declan