This project is read-only.

DropDown Attribute

public class ViewModel
{
     [DropDown("birds")]
     public string Bird { get; set; }
}

public ActionResult DropDownFromViewDataExample()
{
     ViewData["birds"] = new SelectList( new[] {"blue jay", "robin"} );
     var model = new ViewModel();
     return View( model );
}

if you prefer a more strongly typed approach. I suggest you visit the DropDown model.

Last edited Feb 22, 2011 at 3:54 AM by brk6004, version 6

Comments

No comments yet.