When does a radio button selection change not trigger an update?
When the radio button selection changes, I would like to show / hide the pane in the next cell of the table. I have it hiding and showing well, but every time it makes the page refresh to the top. Is their way to stop this update? I would like to hide and show the panel dynamically.
<table>
<tr>
<td>
<asp:RadioButtonList runat="server" ID="rblPlayerStatus" AutoPostBack="true" >
<asp:ListItem>Free Agent</asp:ListItem>
<asp:ListItem>I have teammate</asp:ListItem>
</asp:RadioButtonList>
</td>
<td>
<asp:Panel runat="server" ID="pnlTeamMate">
<asp:Label runat="server" ID="lblTeamMate" Text="Choose Teammate" />
</asp:Panel>
</td>
</tr>
</table>
+2
a source to share
4 answers
From your code, I can't see where you hide and show the panel. You can use the refresh panel, but this is best used when you need to get more information from the server.
If you just want to show and hide the panel, you can do it better with Javascript by adding some code to the OnClick event to set the panel's visibility css attribute. There are several google guides on how to do this. Something like this should be enough to get you started.
0
a source to share