【发布时间】:2013-06-26 19:40:22
【问题描述】:
我有这个enum 的国家/地区:
public enum Country
{
[Display(Description ="Netherlands", ResourceType = typeof(MyResource))]
Netherlands = 0,
[Display(Description = "Germany", ResourceType = typeof(MyResource))]
Germany = 1,
[Display(Description = "Belgium", ResourceType = typeof(MyResource))]
Belgium = 2,
[Display(Description = "Luxembourg", ResourceType = typeof(MyResource))]
Luxembourg = 3,
[Display(Description = "France", ResourceType = typeof(MyResource))]
France = 4,
[Display(Description = "Spain", ResourceType = typeof(MyResource))]
Spain = 5
}
这是在MultiSelectList 中显示枚举的扩展方法:
public static MvcHtmlString MultiSelectBoxFor<TModel, TProperty>(this HtmlHelper<TModel> htmlHelper, Expression<Func<TModel, TProperty>> expression, IEnumerable<SelectListItem> selectList)
{
return htmlHelper.ListBoxFor(expression, selectList, new { @class = "chzn-select", data_placeholder = Form.MultiSelect });
}
此MultiSelectList 具有“选择”风格。请参阅this 网站了解更多信息
当我不需要它来支持更多语言等时,这一切都很好。
如何通过本地化来完成这项工作?
【问题讨论】:
-
thread 中提出了类似的问题。
-
您好,谢谢!看起来很棒。您可以发表您的评论作为答案,以便我标记它吗?
-
它不允许我发布它作为答案,所以我只是照原样复制它
标签: asp.net-mvc localization multi-select