Ampersands being converted when in data that is bound to my ASP:Dropdown

H

Howard, Brett

I am binding data to the <ASP:Dropdown> object. My field that I am binding
to the DataTextField property has "&nbsp;" in the data out of the database.
The problem that I am having is that when the page is rendered to the
browser, the "&nbsp;" is changed to "&amp;nbsp;". Is there a way to stop
the conversion of my data? What I am trying to accomplish is to have some
drop down items to be tabbed in. So, if you know how to tab items in a
dropdown, that can also solve my issue.
 
P

Prasad

Hi

Assume the DropDownList ID is MenuList. The following code will add Space to
the ListItem :

MenuList.Items.Add(new
ListItem(Server.HtmlDecode("&nbsp;&nbsp;UserGroup"),"UserGroup"));



HTH
Prasad
 

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,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top