Adding   to a dropdown

  • Thread starter Thread starter Rob T
  • Start date Start date
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.
 
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
 
try Server.HtmlDecode(" ");
--
Regards

John Timney
Microsoft Regional Director
Microsoft MVP
 
Back
Top