In the C # part:
Using a new keyword
var genericResult = new { homeworkData = homework, attachmentData = homeworkAttachment };
var result = this.Json(genericResult, JsonRequestBehavior.AllowGet);
return result;
In the jquery field:
function getHomewrokDetailResponse(dataSent, result) {
if (result && result.homeworkData) {
homeworkId = result.homeworkData.homeworkId;
....
}
if (result && result.attachmentData) {
xy = result.attachmentData.xyz;
....
}
source
share