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

python - Why doesn't list have safe "get" method like dictionary? -

razor - Is this a bug in WebMatrix PageData? -

sql server - Stored procedure -