Saturday, 15 June 2013

asp.net - Text property of ListItem that created dynamically -


For the dropdown list ASP.net control I create several ListItem dynamically, and some list of this list is needed, two or three is near "Space". I try this:
  var li = new list item {text = "& amp; nbsp; & amp; nbsp; & amp; nbsp; +" item "};   

But in the HTML rendered page, this text appears ==> '& amp; nbsp; & amp; nbsp; and & nbsp; items'

What should I do?

Try decoding the first letter characters ...

  li.Text = HttpUtility.HtmlDecode ("& amp; nbsp; & amp; nbsp; & amp; nbsp;") + "item";    

No comments:

Post a Comment