Using [Display(Name = “X”)] with an enum. Custom HtmlHelper in MVC3 ASP.Net

前端 未结 3 2521
余生分开走
余生分开走 2021-02-20 16:31

Im using a snippet of code from another stackoverflow question:

namespace MvcHtmlHelpers
{
    public static class htmlHelpers
    {
        /// 
         


        
3条回答
  •  北荒
    北荒 (楼主)
    2021-02-20 17:10

    I use [Description] in my code, but you can simply change that to use DisplayAttribute:

    https://gist.github.com/1287511

提交回复
热议问题