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

  • Thread starter Thread starter Howard, Brett
  • Start date Start date
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.
 
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
 
Back
Top