public ActionResult Create() { //Model padrão da página Local model = new Local() { Id = 1, Description = "Local 1", SupplierId = 3 }; //DropDownList com Identificação do SupplierId = 3 ViewData["SupplierId"] = new SelectList(dal.All(), "Id", "Name", model.SupplierId); return(View(model)); }
public ActionResult Index() { ViewData["Suppliers"] = new SelectList(dal.All(), "Id", "Name"); return(View()); }