public JsonResult ModalReinvitePopupUser(int testid, string role, string term = "") { var common = new CommonService(); common.OnRenderSubPartialViewToString += (model) => { var result = String.Empty; try { result = this.RenderPartialViewToString("P_Modal_Invitation_User_Item", model); } catch (Exception) { common.success = false; common.message = Constants.DefaultExceptionMessage; } return result; }; common.OnRenderPartialViewToString += (model) => { var result = String.Empty; try { ViewBag.Role = role; result = this.RenderPartialViewToString("P_Modal_Reinvite_Tests_For_Users", model); } catch (Exception) { common.success = false; common.message = Constants.DefaultExceptionMessage; } return result; }; common.ModalReinvitePopupUser(testid, role, term); return Json(new { common.success, common.message, common.generatedHtml, common.resultlist }); }