public ActionResult GetAllNotifications(NotificationsModel getNotifications) { if (Convert.ToString(Session["key"]) != "admin") { return(RedirectToAction("Login", "Home")); } Admin_Api adminApi = new Admin_Api(); getNotifications.AdminID = (int)System.Web.HttpContext.Current.Session["UserId"]; //6003; var notificationsModels = adminApi.GetAllNotifications(getNotifications); return(View("~/Views/Administrator/AdminManageNotifications.cshtml", notificationsModels)); }