473,406 Members | 2,281 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,406 software developers and data experts.

Adding   to a dropdown

I have a dropdown list that I would like to put in a bunch of  's into
it (I'm setting the font to a monospace font so I can show a couple of
columns nice and neat).

In the old asp days, I had no problem doing this, but now if I try to do
something like this...

boxOption.Items.Add(New ListItem("myFirstCol   myLastCol"))

....it converts each & to a &

Any way to make the non-breaking space to work properly...or should I say,
they way I want it to?

Thanks.

-Rob T.

Nov 18 '05 #1
2 1964
Rob,

This behaviour is hard-coded into the RenderContents method of the
DropDownList class. Luckily, DropDownList is not sealed, so you can
easily override the behaviour.

HTH,
Nicole
"Rob T" <RT*********@DONTwalchemSPAM.com> wrote in message
news:u6**************@TK2MSFTNGP12.phx.gbl...
I have a dropdown list that I would like to put in a bunch of &nbsp;'s into
it (I'm setting the font to a monospace font so I can show a couple of
columns nice and neat).

In the old asp days, I had no problem doing this, but now if I try to do
something like this...

boxOption.Items.Add(New ListItem("myFirstCol&nbsp;&nbsp;&nbsp;myLastCol"))

...it converts each & to a &amp;

Any way to make the non-breaking space to work properly...or should I say,
they way I want it to?

Thanks.

-Rob T.

Nov 18 '05 #2
try Server.HtmlDecode("&nbsp;");
--
Regards

John Timney
Microsoft Regional Director
Microsoft MVP
"Rob T" <RT*********@DONTwalchemSPAM.com> wrote in message
news:u6**************@TK2MSFTNGP12.phx.gbl...
I have a dropdown list that I would like to put in a bunch of &nbsp;'s into it (I'm setting the font to a monospace font so I can show a couple of
columns nice and neat).

In the old asp days, I had no problem doing this, but now if I try to do
something like this...

boxOption.Items.Add(New ListItem("myFirstCol&nbsp;&nbsp;&nbsp;myLastCol"))

...it converts each & to a &amp;

Any way to make the non-breaking space to work properly...or should I say,
they way I want it to?

Thanks.

-Rob T.

Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Tjerk Wolterink | last post by:
In XHTML the entity nbsp stands for   A normal space like " " is also displayed as an normal space, but multiple spaces like " " are interpreted as 1 space in the xhtml page. So there comes...
12
by: Robert Mark Bram | last post by:
Hi All, I am using the following trim function: function trim (str) { return str.replace(/^\s*/g, '').replace(/\s*$/g, ''); } The problem is that this doesn't trim instances of the...
2
by: Bill Green | last post by:
I am trying to add an indent to a Dropdown control. I prefix the text for the ListItem with a couple &nbsp; but it doesn't render the tags to spaces , instead the dropdown list shows: MainItem...
5
by: Tim | last post by:
Hi, I am trying to load up a drop list with semi aligned columns like so: Item 2 Something Else etc. To do so, I have tried to fill the Text valus of ListItems like so:
9
by: Jouni Karppinen | last post by:
I create a HTMLTable in my C# code and then add rows and cells into that table. I'm trying to set top and bottom border for each cell by using stylesheet and it works as far as cell has some text...
3
by: yawnmoth | last post by:
<? echo 'a'.trim(html_entity_decode('&nbsp;a&nbsp;')).'a'; ?> Shouldn't PHP output aaa? Looking at the documentation for trim I see that it doesn't support chr(0xA0) (eg....
28
by: entfred | last post by:
I have the following line of html: &nbsp;&nbsp1234&nbsp;&nbsp;&nbsp;&nbsp;&nbspabc&nbsp;&nbsp;&nbspyow In Internet Explorer 6.0, the columns look ok using the above html: 1234 abcd ...
2
by: OJ | last post by:
Hi, ASP.NET C# 2.0 I have a usercontrol which contains a Gridview. I create my own DataTable to bind to the GridView, which then fires the RowDataBound event of the the Gridview. Here I add a...
7
by: Sebarry | last post by:
Hi, I'm having trouble creating a blank table row in Javascript using document.createElement( '&nbsp;' ). When I look at the generated source it has intrepreted it as <td>&amp;nbsp;</td>. What do I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...
0
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.