0

I create many ListItem dynamically for a DropDownList ASP.net control, and need some of this ListItem's Text Property, have two or three "Space". I try this:

var li = new ListItem { Text = "   " + "Item" };

but in HTML rendered page, it's text appears ==> '   Item'

What should I do?

4

1 回答 1

0

Try to decode the space characters first...

li.Text = HttpUtility.HtmlDecode("   ") + "Item";
于 2013-06-23T01:22:39.160 回答