473,323 Members | 1,570 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,323 software developers and data experts.

RadioButtonList Renders Differently in 2.0 than 1.1

I tried Google to see if this has been an issue for other people but did not
find anything.
In my ASP.Net 1.1 application the radio button list renders the way I want
it.
But after converting to 2.0, the same control renders differently.

<asp:radiobuttonlist id="opgAction" runat="server" BorderStyle="None"
Font-Bold="False" RepeatLayout="Flow">
<asp:LISTITEM Value="A">&nbsp;&nbsp;</asp:LISTITEM>
<asp:LISTITEM Selected="True" Value="R">&nbsp;&nbsp;</asp:LISTITEM>
<asp:LISTITEM Value="G">&nbsp;&nbsp;</asp:LISTITEM>
<asp:LISTITEM Value="H">&nbsp;</asp:LISTITEM>
</asp:radiobuttonlist>

The first list item is rendered like this in 1.1 (notice that the label has
a blank value between the tags):
<input id= "rptr1__ctl1_rptr2__ctl0_opgAction_0" type="radio"
name="rptr1:_ctl1:rptr2:_ctl0:opgAction" value="A"/>
<label for="rptr1__ctl1_rptr2__ctl0_opgAction_0" </label>

But in 2.0 it renders like this (notice that the labe has an A between the
tags):
<input id= "rptr1__ctl1_rptr2__ctl0_opgAction_0" type="radio"
name="rptr1:_ctl1:rptr2:_ctl0:opgAction" value="A"/>
<label for="rptr1__ctl1_rptr2__ctl0_opgAction_0">A</label>

I do not want the A to be between the label tags. I do not want the Values
to appear on the screen.

Is there something I can change in the control to get it to render the old
way?
Is there some code or script I can write to modify this behavior?
Anyone else ever have a problem with this?
--
Joe Fallon


Nov 28 '06 #1
1 1726
The answer to the problem is to move the &nbsp; from between the tags to the
Text property instead:

<asp:LISTITEM Value="A" Text="&nbsp;&nbsp;"></asp:LISTITEM>

--
Joe Fallon

"Joe Fallon" <jf******@nospamtwcny.rr.comwrote in message
news:eR**************@TK2MSFTNGP04.phx.gbl...
>I tried Google to see if this has been an issue for other people but did
not find anything.
In my ASP.Net 1.1 application the radio button list renders the way I want
it.
But after converting to 2.0, the same control renders differently.

<asp:radiobuttonlist id="opgAction" runat="server" BorderStyle="None"
Font-Bold="False" RepeatLayout="Flow">
<asp:LISTITEM Value="A">&nbsp;&nbsp;</asp:LISTITEM>
<asp:LISTITEM Selected="True" Value="R">&nbsp;&nbsp;</asp:LISTITEM>
<asp:LISTITEM Value="G">&nbsp;&nbsp;</asp:LISTITEM>
<asp:LISTITEM Value="H">&nbsp;</asp:LISTITEM>
</asp:radiobuttonlist>

The first list item is rendered like this in 1.1 (notice that the label
has a blank value between the tags):
<input id= "rptr1__ctl1_rptr2__ctl0_opgAction_0" type="radio"
name="rptr1:_ctl1:rptr2:_ctl0:opgAction" value="A"/>
<label for="rptr1__ctl1_rptr2__ctl0_opgAction_0" </label>

But in 2.0 it renders like this (notice that the labe has an A between the
tags):
<input id= "rptr1__ctl1_rptr2__ctl0_opgAction_0" type="radio"
name="rptr1:_ctl1:rptr2:_ctl0:opgAction" value="A"/>
<label for="rptr1__ctl1_rptr2__ctl0_opgAction_0">A</label>

I do not want the A to be between the label tags. I do not want the Values
to appear on the screen.

Is there something I can change in the control to get it to render the old
way?
Is there some code or script I can write to modify this behavior?
Anyone else ever have a problem with this?
--
Joe Fallon


Nov 28 '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 --...
6
by: DotNetGruven | last post by:
I have a webform that has a DataGrid on it with a RadioButtonList in each row. It is a simple On & Off. When the User Clicks on either of the RadioButtons, I need to postback to the server and...
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...
4
by: strout | last post by:
I want to do some client-side operation by click different radiobuttonlist. I tried to add "onclick" event for each itemlist, by register startup clientside javascript. But the problem is I...
3
by: Jason Honn | last post by:
I have an .aspx page that renders fine in IE6, but it does not render properly in Firefox. If I change the extension from .aspx to .htm everything renders just fine in Firefox. The problem I am...
5
by: dighazuse | last post by:
trying to get a javascript attached to a DataGrid RadioButtonList. I have a similar thing working for a DDL so i copied that for the RBL. It "errors" when i am trying to get the current selected...
4
by: Marty | last post by:
I am using: VS2005 Pro WinXP Pro SP2 IIS 5.1 ..NET Framework 2.0.50727 I create a website using File>New>Web Site>ASP.NET. I put a ListBox, DropDownList, CheckBoxList and RadioButtonList on...
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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.