Controller中的方法,返回JsonResult 类型
publicJsonResult ChaoQiReport(XuQiuReportOutModel model)
{
XuQiuReportOutModel report = newXuQiuReportOutModel();
report = this.GetData(model);
return Json(report.pDCList);
}
HTML页面展示:
$("a[name='dxchaoqi']").click(function() {
$.ajax({
type: "POST",
dataType: "json",
url: "/Manager/XuQiuReport/ChaoQiReport", //调用Controller中的方法
data: { CityName: $(this).attr("city"), StartTime: '@ViewBag.XuQiuReportOutModel.StartTime'}, //后台需要的参数
cache: false,
success: function (data) {
if(data != null) {
varobj = eval(data);
varstr = "";
for(i in obj) {
str += "