473,659 Members | 2,836 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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:radiobutto nlist id="opgAction" runat="server" BorderStyle="No ne"
Font-Bold="False" RepeatLayout="F low">
<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:radiobutton list>

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_rp tr2__ctl0_opgAc tion_0" type="radio"
name="rptr1:_ct l1:rptr2:_ctl0: opgAction" value="A"/>
<label for="rptr1__ctl 1_rptr2__ctl0_o pgAction_0" </label>

But in 2.0 it renders like this (notice that the labe has an A between the
tags):
<input id= "rptr1__ctl1_rp tr2__ctl0_opgAc tion_0" type="radio"
name="rptr1:_ct l1:rptr2:_ctl0: opgAction" value="A"/>
<label for="rptr1__ctl 1_rptr2__ctl0_o pgAction_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 1744
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;&nb sp;"></asp:LISTITEM>

--
Joe Fallon

"Joe Fallon" <jf******@nospa mtwcny.rr.comwr ote in message
news:eR******** ******@TK2MSFTN GP04.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:radiobutto nlist id="opgAction" runat="server" BorderStyle="No ne"
Font-Bold="False" RepeatLayout="F low">
<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:radiobutton list>

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_rp tr2__ctl0_opgAc tion_0" type="radio"
name="rptr1:_ct l1:rptr2:_ctl0: opgAction" value="A"/>
<label for="rptr1__ctl 1_rptr2__ctl0_o pgAction_0" </label>

But in 2.0 it renders like this (notice that the labe has an A between the
tags):
<input id= "rptr1__ctl1_rp tr2__ctl0_opgAc tion_0" type="radio"
name="rptr1:_ct l1:rptr2:_ctl0: opgAction" value="A"/>
<label for="rptr1__ctl 1_rptr2__ctl0_o pgAction_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
5661
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 dataentry form for edit, I search the database for the row containing the data I want, and then populate all the form fields. here is what I have so far. What I don't know what to do is for cases where a dirty database has no associated value for the...
5
5503
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 -- -- BoundColumn 1 -- -- BoundColumn 2 -- -- TemplateColumn 4 -- -- RadioButtonList --
6
7731
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 update the database. Here is the control containment hierarchy: ASP Page Static User Control // just provides a pretty border around
4
9651
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 with like a table layout and in the last column I want to have three radio buttons (for each row in repeater). The value of the radio button should be calculated from a value from the dataset. How can I do that? When I try to use a variable...
4
4445
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 cannot get document.getElementById work, because the list item id generated by ASP.net is like myRdoList_0, myRdoList_1 ... and the names are "myRdoList". While document.getElementById is supposed to identify element BY NAME but not by ID attribute. ...
3
2048
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 having deals with stretching nested tables to fill the cell they are nested in completely. I have specified the embedded table to have a height of "100%", but it acts as if no height is given. Any help would be greatly appreciated.
5
6257
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 value for the RBL. code in ItemDataBound: rblDC.Attributes.Add("onClick", "rblDC_onClick('" + lblDC.ClientID + "', '" + rblDCodes.ClientID + "', '" + e.Item.ItemType + "')");
4
2418
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 the default page. Compile the page and surf to it using IE or Firefox (I get the same
6
2635
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 in the page and I've got code to get the selected value from it in the Radiobuttonlist_SelectedIndexChanged event. The code in there is: Protected Sub rblFMSValue_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)
0
8332
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8851
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8746
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8627
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7356
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4175
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4335
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1737
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.