// GET: Vehicles/Create public ActionResult Create() { // Handles HTTP GET, and returns a view with an HTML Form // Notice that we're initializing an object to push initial data into the view // Prepare the data for the view var addForm = new VehicleAddForm(); addForm.ModelYear = DateTime.Now.Year; // Configure the "select" user interface control items addForm.Manufacturers = new SelectList(m.ListOfManufacturers, "Id", "Name"); return View(addForm); }
// GET: Vehicles/Create public ActionResult Create() { // Handles HTTP GET, and returns a view with an HTML Form // Notice that we're initializing an object to push initial data into the view // Prepare the data for the view var addForm = new VehicleAddForm(); addForm.ModelYear = DateTime.Now.Year; // Configure the "select" user interface control items addForm.Manufacturers = new SelectList(m.ListOfManufacturers, "Id", "Name"); return(View(addForm)); }