I have a radiobutton list (With 2 rdb) and a check list (7 ckb). I would like the checkbox list appears only when the user selects the second radio button is checked.
I never used AJAX before.
My actual code (yes, they are inside a table):
<td>
<asp:Label ID="Label7" runat="server" Font-Bold="True">Frequency</asp:Label>
<table>
<tr>
<td>
<asp:RadioButtonList ID="rdbDaysList" runat="server" AutoPostBack="True" OnSelectedIndexChanged="rdbDaysList_SelectedIndexChanged"
RepeatColumns="2" CausesValidation="True">
<asp:ListItem>Daily</asp:ListItem>
<asp:ListItem>Weekly</asp:ListItem>
</asp:RadioButtonList>
</td>
</tr>
<tr>
<td class="style3">
<asp:CheckBoxList ID="ckbList" runat="server" Visible="false" RepeatColumns="5" RepeatDirection="Horizontal">
<asp:ListItem>Monday</asp:ListItem>
<asp:ListItem>Tuesday</asp:ListItem>
<asp:ListItem>Wednesday</asp:ListItem>
<asp:ListItem>Thursday</asp:ListItem>
<asp:ListItem>Friday</asp:ListItem>
<asp:ListItem>Saturday</asp:ListItem>
<asp:ListItem>Sunday</asp:ListItem>
</asp:CheckBoxList>
</td>
</tr>
</table>
</td>
Thanks in advance!
You’ll need to surround the radion button and check box list with an UpdatePanel control. Then in the OnSelectIndexChanged event on the radio button control, set the Visible property of then check box list to true.