Beispiel #1
0
        //
        // Products/Edit/5

        public ActionResult Edit(int id)
        {
            var viewData = new ProductsEditViewData {
                Product = northwind.GetProductById(id)
            };

            viewData.Categories = new SelectList(northwind.GetCategories(), "CategoryID", "CategoryName", viewData.Product.CategoryID);
            viewData.Suppliers  = new SelectList(northwind.GetSuppliers(), "SupplierID", "CompanyName", viewData.Product.SupplierID);

            return(View("Edit", viewData));
        }