public ActionResult Index() { var formWithData = new SampleForm { FirstName = "Han", LastName = "Solo", EmailAddress = "*****@*****.**", FavoriteColors = new[] { "blue", "green", "gray" }, FavoriteNumbers = new[] { 1, 2, 3, 4, 5 } }; return View(formWithData); }
public ActionResult Index(SampleForm form) { form.ID = 99; return View(form); }
public ActionResult GetFormWithData(SampleForm form) { form.ID = 99; return View("Index", form); }