By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,354 Members | 1,042 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,354 IT Pros & Developers. It's quick & easy.

Label In Between RadioButtonList

P: n/a
A ASPX page has a RadioButtonList with 2 ListItems - 'Yes' & 'No'

<form runat="server">
<asp:RadioButtonList ID="rdlAdd" OnSelectedIndexChanged="ShowHide"
AutoPostBack="true" runat="server">
<asp:ListItem Value="yes">Yes</asp:ListItem>
<asp:ListItem Value="no">No</asp:ListItem>
</asp:RadioButtonList>
</form>

When the page loads for the first time, neither of the 2 RadioButtons
are checked by default.

What I want is when a user checks the 'Yes' RadioButton, a Label should
get displayed IN BETWEEN the 2 RadioButtons. In other words, the Label
should be displayed immediately after the 'Yes' RadioButton. If the
'No' RadioButton is checked, then the already rendered Label in between
the 2 RadioButtons should become invisible & another Label should be
displayed after the 'No' RadioButton.

The problem is how do I display a Label control IN BETWEEN the 'Yes' &
'No' RadioButtons when the 'Yes' RadioButton is checked?

Oct 6 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
I dont have the visual studio open but this seems to be an easy task
.... all you need to do is in the server event iterate thru the
RadioButtonList.Items collection and change the ListItem.Text property
to "" for the radio button for which you dont want any txt displayed.
....
hope that helps ..

rn**@rediffmail.com wrote:
A ASPX page has a RadioButtonList with 2 ListItems - 'Yes' & 'No'

<form runat="server">
<asp:RadioButtonList ID="rdlAdd" OnSelectedIndexChanged="ShowHide"
AutoPostBack="true" runat="server">
<asp:ListItem Value="yes">Yes</asp:ListItem>
<asp:ListItem Value="no">No</asp:ListItem>
</asp:RadioButtonList>
</form>

When the page loads for the first time, neither of the 2 RadioButtons
are checked by default.

What I want is when a user checks the 'Yes' RadioButton, a Label should
get displayed IN BETWEEN the 2 RadioButtons. In other words, the Label
should be displayed immediately after the 'Yes' RadioButton. If the
'No' RadioButton is checked, then the already rendered Label in between
the 2 RadioButtons should become invisible & another Label should be
displayed after the 'No' RadioButton.

The problem is how do I display a Label control IN BETWEEN the 'Yes' &
'No' RadioButtons when the 'Yes' RadioButton is checked?
Oct 6 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.