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[] { "©", "<">", "©" }; var selectlistitems = entities.select(e => new selectlistitem { text = httputility.htmldecode(e), value = "1" }); %> <%= html.dropdownlist("exampledropdownlist", selectlistitems) %>
Comments
Post a Comment