public ActionResult PageUser() { string actionName = this.ControllerContext.RouteData.Values["action"].ToString(); string controllerName = this.ControllerContext.RouteData.Values["controller"].ToString(); string pagename = @"/" + controllerName + @"/" + actionName; var page = (List <LP_Pages_Property>)Session["PageList"]; if (Session["LoggedIn"] != null && Helper.CheckPageAccess(pagename, page) && Session["ISADMIN"] != null && Convert.ToBoolean(Session["ISADMIN"].ToString()) == true) // if (Session["LOGGEDIN"] != null) { LP_PageUser_Property objpage = new LP_PageUser_Property(); objUserBll = new User_BLL(); objpage.PageList = Helper.ConvertDataTable <LP_Pages_Property>(objUserBll.GetAllPages()); User_Property objUserProperty = new User_Property(); objUserProperty.branchIdx = 1;//user logged in session branchIdx User_BLL objUser = new User_BLL(objUserProperty); var Data = JsonConvert.SerializeObject(objUser.ViewAll()); objpage.UserList = Helper.ConvertDataTable <User_Property>(objUser.ViewAll()); ViewBag.Pagelist = objpage.PageList; return(View(objpage)); } else { if (Session["LoggedIn"] == null) { return(RedirectToAction("Login", "Account")); } else { return(RedirectToAction("NotAuthorized", "Account")); } } }