public JsonResult SearchUserItems(int testid, string term, string type) { var common = new CommonService(); common.OnRenderPartialViewToString += (model) => { var result = string.Empty; try { result = this.RenderPartialViewToString("P_User_Item", model); } catch (Exception) { common.success = false; common.message = Constants.DefaultExceptionMessage; } return result; }; common.SearchUserItems(testid, term, type); return Json(new { common.message, common.success, common.resultlist }); }