How to emit unencoded html in the dropdown list in ASP.NET MVC -


i want populate dropdown list trademark , copyright characters looks html encoded instead encoded form.

thanks help.

when populating selectlist, use httputility.htmldecode on text. here's example:

<% var entities = new string[] { "&copy;", "&lt;&quot;&gt;", "&#169;" }; var selectlistitems = entities.select(e => new selectlistitem {                                      text = httputility.htmldecode(e), value = "1"                                 }); %>  <%= html.dropdownlist("exampledropdownlist", selectlistitems) %> 

Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

android - layout with fragment and framelayout replaced by another fragment and framelayout -