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); }