public ActionResult Index() { var model = new SearchViewModel(); if (Session["SearchViewModel"] != null) { model = (SearchViewModel)Session["SearchViewModel"]; model.DocTypes.Clear(); model.SubDocTypes.Clear(); model.ManCos.Clear(); model.AddSubDocTypes(_subDocTypeService.GetSubDocTypes(Convert.ToInt32(model.SelectedDocId))); } var docTypes = _docTypeService.GetDocTypes(); var currentUser = this._userService.GetApplicationUser(); var manCos = this._manCoService.GetManCosByUserId(currentUser.Id); model.AddDocTypes(docTypes); model.AddMancos(manCos); if (Session["ManCoFilter"] != null) { ManCoFilterViewModel mModel = (ManCoFilterViewModel)Session["ManCoFilter"]; if (mModel.SelectedManCoId != null) { model.SelectedManCoId = mModel.SelectedManCoId; } } return(PartialView("_Index", model)); }