ASP.NET MVC Generate DropDownList using UIHint Attribute
问题 I would like to know how can I generate a DropDownList using an UIHint attribute. I already customized some of the predefined attributes but I don't know how to proceed for generating DropDownLists. Here is how I did with my last one and I want to use it in a similar way: public class CartProduct { [Required] [UIHint("Spinner")] public int? Quantity { get; set; } [Required] [UIHint("MultilineText")] public string Description { get; set; } } 回答1: Here's an (untested) general example using