public ActionResult Index() { var fuels = GetFuels(); var model = new Samochod(); model.Paliwa = GetSelectListItems(fuels); return View(model); }
public ActionResult Index(Samochod model) { var fuels = GetFuels(); model.Paliwa = GetSelectListItems(fuels); if (ModelState.IsValid) { Session["Samochod"] = model; return RedirectToAction("Result"); } return View("Index", model); }