Adding   to a dropdown

R

Rob T

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.
 
N

Nicole Calinoiu

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
 
J

John Timney \(Microsoft MVP\)

try Server.HtmlDecode(" ");
--
Regards

John Timney
Microsoft Regional Director
Microsoft MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top