填充SelectList时,请在文本上使用HttpUtility.HtmlDecode.这是一个例子:
<%
var entities = new string[] { "©", "<">", "©" };
var selectListItems = entities.Select(e => new SelectListItem {
Text = HttpUtility.HtmlDecode(e), Value = "1"
});
%>
<%= Html.DropDownList("exampleDropDownList", selectListItems) %>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1767 次 |
| 最近记录: |