By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,852 Members | 2,116 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,852 IT Pros & Developers. It's quick & easy.

Adding   to a dropdown

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.