コード例 #1
0
        public ActionResult Create([Bind(Include = "id,previd,parentidPrev,parentid,title,state,menuType_id,site_id,сontent_id")] Menus menus)
        {
            if (ModelState.IsValid)
            {
                menusHandler.Add(menus);
                return(RedirectToAction("Index"));
            }

            ViewBag.сontent_id  = new SelectList(_contentsHandler.All(), "id", "title", menus.сontent_id);
            ViewBag.menuType_id = new SelectList(menutypesHandler.All(), "id", "title", menus.menuType_id);
            ViewBag.site_id     = new SelectList(sitesHandler.All(), "id", "title", menus.site_id);
            return(View(menus));
        }