I'm attempting to teach myself ASP.NET and VB2005 and I'm definately struggling. Any help would be greatly appreciated!
I have a series of radiobuttons within a nested repeater, and I need to know which button the user selects. I also want to change the appearance of the selected button.
As far as I can see, I'd need to use the ItemCommand event of the nested repeater but I can't figure out how to get to it. I tried adding an 'onItemCommand' parameter to the nested repeater but the event doesn't seem to fire.
Below is my code for the nested repeaters. Everything works great as far as displaying the data, but I can't interact with it.
<asp:Repeater ID="RepFactor" runat="server" OnItemDataBound="GetQuestions" >
<HeaderTemplate><table></HeaderTemplate>
<ItemTemplate>
<tr>
<td ><%#DataBinder.Eval(Container.DataItem, "Factor_Title")%></td>
</tr>
<tr>
<td>
<asp:Repeater ID="RepQuestions" runat="server" >
<HeaderTemplate><table></HeaderTemplate>
<ItemTemplate>
<tr>
<td><%#DataBinder.Eval(Container.DataItem, "Question_No")%></td>
<td><%#DataBinder.Eval(Container.DataItem, "Question_Text")%></td>
<td>
<asp:RadioButton ID="rbEO" runat="server" GroupName="btns" />
<asp:RadioButton ID="rbFM" runat="server" GroupName="btns" />
<asp:RadioButton ID="rbMO" runat="server" GroupName="btns" />
<asp:RadioButton ID="rbNI" runat="server" GroupName="btns" />
<asp:RadioButton ID="rbLN" runat="server" GroupName="btns" />
</td>
</tr>
</ItemTemplate>
<FooterTemplate></table></FooterTemplate>
</asp:Repeater>
</td>
</tr>
</ItemTemplate>
<FooterTemplate></table></FooterTemplate>
</asp:Repeater>
I have a series of radiobuttons within a nested repeater, and I need to know which button the user selects. I also want to change the appearance of the selected button.
As far as I can see, I'd need to use the ItemCommand event of the nested repeater but I can't figure out how to get to it. I tried adding an 'onItemCommand' parameter to the nested repeater but the event doesn't seem to fire.
Below is my code for the nested repeaters. Everything works great as far as displaying the data, but I can't interact with it.
<asp:Repeater ID="RepFactor" runat="server" OnItemDataBound="GetQuestions" >
<HeaderTemplate><table></HeaderTemplate>
<ItemTemplate>
<tr>
<td ><%#DataBinder.Eval(Container.DataItem, "Factor_Title")%></td>
</tr>
<tr>
<td>
<asp:Repeater ID="RepQuestions" runat="server" >
<HeaderTemplate><table></HeaderTemplate>
<ItemTemplate>
<tr>
<td><%#DataBinder.Eval(Container.DataItem, "Question_No")%></td>
<td><%#DataBinder.Eval(Container.DataItem, "Question_Text")%></td>
<td>
<asp:RadioButton ID="rbEO" runat="server" GroupName="btns" />
<asp:RadioButton ID="rbFM" runat="server" GroupName="btns" />
<asp:RadioButton ID="rbMO" runat="server" GroupName="btns" />
<asp:RadioButton ID="rbNI" runat="server" GroupName="btns" />
<asp:RadioButton ID="rbLN" runat="server" GroupName="btns" />
</td>
</tr>
</ItemTemplate>
<FooterTemplate></table></FooterTemplate>
</asp:Repeater>
</td>
</tr>
</ItemTemplate>
<FooterTemplate></table></FooterTemplate>
</asp:Repeater>