MVC代码片段备忘录
MSDN的MVC文档链接,http://msdn.microsoft.com/en-us/library/dd394709.aspx
Both the DropDownList and ListBox helpers accept either a SelectList or MultiSelectList object.
List<string> petList = new List<string>(); petList.Add("Dog"); petList.Add("Cat"); petList.Add("Hamster"); petList.Add("Parrot"); petList.Add("Gold fish"); petList.Add("Mountain lion"); petList.Add("Elephant"); ViewData["Pets"] = new SelectList(petList);