返回顶部

收藏

asp.net mvc3中的ajax

更多

访问home控制器下的getdev action,返回的结果为json格式。

$.ajax({
type: "GET",
url: "/home/getdev",
data: "{}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(msg) {
// Do something interesting here.
console.log(msg);
}
});//ajax ends here

public JsonResult GetDev()
{
return Json(new {author = "najam sikander awan", email="najamsk@gmail.com"},JsonRequestBehavior.AllowGet);
}

标签:asp.net,mvc,json

收藏

0人收藏

支持

0

反对

0

发表评论