【发布时间】:2015-05-29 08:57:35
【问题描述】:
目前在我的 mvc 视图中在 DropDownList 中显示枚举值,但名称“Brittish_Airways”看起来不友好,试图在我的视图中替换“Brittish_Airways”中的“Brittish Airways”,该怎么做?
在 enumdropdowlist 中显示特殊字符/符号空格
我的枚举:-
public enum EventType
{
Other = 0,
Birth = 1,
Marriage = 2,
Death = 3,
Brittish_Airways=4
}
我的参考代码:->
<li>
@Html.DropDownListFor(model => model.EventTypeText,
Enum.GetNames(typeof(ABC.Web.EventType))
.Select(e =>
new SelectListItem { Text = e
}),
new { @class = "ddlEventType ddl" })
</li>
【问题讨论】:
-
检查我的文章,就像我在我的情况下所做的那样:developmentpassion.blogspot.com/2015/03/…
标签: asp.net-mvc asp.net-mvc-4 drop-down-menu enums