public ActionResult GetSideBar() { var service = new Service(); User user = service.GetUser(User.Identity.Name); if (Request.IsAjaxRequest()) { EventFeedViewModel model = new EventFeedViewModel(); model.SideBar = service.GetSideBar(user.UserID, null); return Json(RenderPartialViewToString("SideBar", model), JsonRequestBehavior.AllowGet); } return View("Index"); }
public ActionResult GetSideBar(int groupId) { var service = new Service(); User user = service.GetUser(User.Identity.Name); if (service.IsMemberOfGroup(user.UserID, groupId)) { if (Request.IsAjaxRequest()) { GroupFeedViewModel model = new GroupFeedViewModel(); model.SideBar = service.GetSideBar(user.UserID, groupId); model.Group = service.GetGroupById(groupId); return Json(RenderPartialViewToString("SideBar", model), JsonRequestBehavior.AllowGet); } } return Json(null, JsonRequestBehavior.AllowGet); }