public JsonResult UnassignTest(int userId, int testId) { var common = new CommonService(); common.OnRenderPartialViewToString += (model) => { var result = string.Empty; try { result = this.RenderPartialViewToString("P_Assign_Test_To_Student", model); } catch (Exception) { common.success = false; common.message = Constants.DefaultExceptionMessage; } return result; }; common.UnassignTest(userId, testId); return Json(new { common.success, common.message ,common.generatedHtml}); }