public ActionResult AjaxForm() { var moduleModel = new Module { IsShow = true, Ord = 0, PrarentID = (ArrId.Any()) ? ArrId.FirstOrDefault() : 0 }; if (DoAction == ActionType.Edit) { moduleModel = _moduleDa.GetById(ArrId.FirstOrDefault()); } var ltsAllItems = _moduleDa.GetAllListSimple(); ltsAllItems = _moduleDa.GetAllSelectList(ltsAllItems, moduleModel.ID, true); ViewBag.PrarentID = ltsAllItems; ViewData.Model = moduleModel; ViewBag.Action = DoAction; ViewBag.ActionText = ActionText; return(View()); }