473,387 Members | 1,574 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Label In Between RadioButtonList

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
1 2329
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Hazzard | last post by:
I store radiobuttonlist values in the db using the string value of the radio button item value. (nvarchar) I am creating an edit functionality on the asp.net form so that when I reuse my...
5
by: DotNetGruven | last post by:
Anyone have any pointers on how to set the Value and Selected attributes in a ListItem in a RadioButtonList that is in a DataGrid? Here's what I have ------DataGrid------ -- BoundColumn 0 --...
2
by: hellrazor | last post by:
Hi there, I'm successfully streaming a list of items into a radiobuttonlist. I am using an ArrayList as a data source, which I have built from a table of values in a MySQL table. It's working...
4
by: Emil | last post by:
Can somebody tell me what would be the syntax for having an if statement and setting the selected index of a radiobuttonlist? This is my first project using ASP.net and I use C#. I have a repeater...
1
by: Venki | last post by:
I have a textbox to enter an email address followed by a telephone textbox. The email has a regularexpressionvalidator and a requiredfieldvalidator. The ReqField works fine, but if I put in an...
5
by: Øyvind Isaksen | last post by:
I'm making a page to update articles. When a radiobuttonlist is displayed, I want the stored value to be displayed as default (checked). Example: I use a procedure to display the...
2
by: hsegoy1979 | last post by:
Dear All Iam new to asp.net. I want to display a panel between two radio buttonlist listitems. I have wriiten in comments in code to display panel position. Here is my code <%@ Page...
1
by: Mich | last post by:
Hi, i made an application where a lot of radiobuttonlists are created dynamically. Some are visible and others are hidden until the right selectedvalue is chosen. Thsi works perfectly with IE7,...
6
by: SAL | last post by:
hello, I'm using a radiobuttonlist in an updatepanel in an item template in a Gridview control. I'm populating the radiobuttonlist in the RowDataBound event. I have the control toolkit registered...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.