I have a repeater and within that repeater, I have an item template. Now this template is formatted with a couple of tables, but for this question I have removed them to make things easier to read:
Expand|Select|Wrap|Line Numbers
- <asp:Repeater ID="Repeater1" OnItemDataBound="R1_ItemDataBound" runat="server">
- <ItemTemplate>
- <asp:PlaceHolder ID="phAnswers" runat="server"></asp:PlaceHolder>
- </ItemTemplate>
- </asp:Repeater>
Expand|Select|Wrap|Line Numbers
- Dim rdList As New RadioButtonList
- Dim newRadio As New RadioButton
- If (e.Item.ItemType = ListItemType.Item) Or _
- (e.Item.ItemType = ListItemType.AlternatingItem) Then
- Dim tempPH As PlaceHolder
- tempPH = e.Item.FindControl("phAnswers")
- For x As Integer = 0 To (t_MC.Count - 1)
- newRadio = New RadioButton
- newRadio.ID = "Answer" + x.ToString
- newRadio.Text = t_MC(x).Value
- rdList.Controls.Add(newRadio)
- Next
- tempPH.Controls.Add(rdList)
Cheers