日期:2014-05-17 浏览次数:20445 次
$.ajax({ type: "POST", url: "/Ajax/PhoneNumber", data: { number: $("#number").val().substring(0, 7) }, contentType: "application/json; charset=utf-8", dataType: "json", success: function (msg) { alert(msg.message); }, error: function (XMLHttpRequest, textStatus, errorThrown) { alert("Status:" + XMLHttpRequest.status + " readyState:" + XMLHttpRequest.readyState + " textStatus:" + textStatus); } });
[HttpPost] public JsonResult PhoneNumber(string number) { string value = BLL.PhoneNumberInfo.Get(number); return Json(new { message = value }, JsonRequestBehavior.AllowGet); //return Content(value); }