how to use enum with DescriptionAttribute in asp.net mvc
问题 I am new to asp.net MVC. I am trying to use dropdown control on my view page, which populates from enum. I also want to add custom descriptions to dropdown values. I searched so many examples, but no one posted how to populated description on view page. Here is my code: ViewModel: public enum SearchBy { [Description("SID/PID")] SID = 1, [Description("Name")] Name, [Description("Birth Date")] DOB, [Description("Cause#")] Cause } Index.cshtml <div class="form-horizontal"> @Html