public ActionResult Index(MyViewModel model) { return Content( string.Format( "Thanks for filling out the form. You selected value: \"{0}\" and other property: \"{1}\"", model.SelectedValue, model.SomeOtherProperty ) ); }
// Renders the main form public ActionResult Index() { ViewBag.Message = "Modify this template to jump-start your ASP.NET MVC application."; var model = new MyViewModel { Values = new[] { new SelectListItem { Value = "1", Text = "item 1" }, new SelectListItem { Value = "2", Text = "item 2" }, new SelectListItem { Value = "3", Text = "item 3" }, } }; return View(model); }