Drop down version of MVC3

I am using @Html.EditorForModel() in several places, and I'm just wondering if there is a simple attribute to indicate that something should be a drop-down list in the view model? An example of what I'm looking for would be ...

 public class MyViewModel { [DropDown("red", "blue", "green")] public string Lasers { get; set; } } 

I know that similar questions have been asked, and I know that I can create my own template that will implement something like this ... I was wondering if this seemingly simple functionality exists, or if there is any NuGet package that added this functionality. It just seems too simple not to exist somewhere, and I may have to make the NuGet package myself, if not already.

Thanks in advance to everyone!

+4
source share
1 answer

Follow this link

http://weblogs.asp.net/scottgu/archive/2009/07/31/asp-net-mvc-v2-preview-1-released.aspx

search for "CountryDropDown" on this page to go to the answer

-1
source

All Articles