How to add " " to list item text

N

Naveen K Kohli

I am try to set the text of the drop down list item as

ListItem li = new ListItem();
li.Text = " "+"MyValue";

myDropDown.Items.Add("li);

The intent is to add a spacing in front of the text. Its not doing what I am
trying to do. The text shows up as "&ampMyValue"

How can this be accomplished?
 
R

Ravikanth[MVP]

Hi
Try this way:
myDropDown.Items.Add(new ListItem(Server.HtmlDecode
("      " + "Ravikanth")));

HTH

Ravikanth[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

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top