Controllers:
public ActionResult PrintTR06(string id)
{
List<Detail_TRBase_06> ListTR06 = new List<Detail_TRBase_06>();
ListTR06.Add(new NARO.DAL.TRBase_06().GetDetail(id));
//1:
string strContent = JsonConvert.SerializeObject(ListTR06);
// return Content(strContent);
//2:
return Json(ListTR06, JsonRequestBehavior.AllowGet);
}
View:
$.ajax({
url: 'PrintTR06?id=' + rowData.RowGuid,
type: "post",
async: false,
success: function (result) {
//1
//$(jQuery.parseJSON(result)).each(function (index, item) {
// // alert(item.CE01);
//});
//2
$.each(result, function (i, item) {
alert(item.CE01);
});
},
error: function (err) {
alert(err.responseText);
}
});