Try to decode the space characters first...
li.Text = HttpUtility.HtmlDecode(" ") + "Item";
Question
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?
Solution
Try to decode the space characters first...
li.Text = HttpUtility.HtmlDecode(" ") + "Item";