I have dynamically generated checkboxs from a Checkbox list which works perfectly.
However I want to be able to fill in one of the boxes as ticked from a session (so users can come back to the page and the answer they selected is still there..
The code below looks right however I get an error...
indexof is not a member of system.web.ui.webcontrols.listitem
as well as
setitemchecked is not a member of system.web.ui.webcontrols.checkboxlist
so I am a little stumped as I got it from the MSDN forum as a correct answer.
Dim I As Integer
For I = 0 To CheckBoxList1.Items.Count - 1
If CheckBoxList1.Items(I).IndexOf(Session.Item("AnswerID" & Session.Item("QuestionIDCounter"))) <> -1 Then
CheckBoxList1.SetItemChecked(I, True)
End If
Next
...
Go to the complete details ...