ajax Post 一直返回的是error ,为什么?
代码如下:ajax提交后,测试发现status==200是正常的,但是一直返回error,为什么?
jquery:
<script type="text/javascript">
function AjaxContent(id) {
$.ajax({
url: "/Yghjy/Detail",
type: "POST",
dataType: "json",
data: { _uid: id },
success: function(data) {
if (data.status != 200) {
alert("ddd");
}
// $(".Content").html("").append(data.HtmlStr);
},
error: function(XMLHttpRequest, textStatus, errorThrown) {
// $.jMessageBox.show('系统消息', '发生网络错误,请重试.');
alert("fff");
}
});
}
</script>
后台code:
public ActionResult Detail()
{
#region 最新动态
var zxdtList = _kdnewsservice.GetKdNewsTab(0, null, "1", 3, 7);
ViewData["zxdtList"] = zxdtList;
#endregion
if (Request["_uid"] != null)
{
var xwnrList = _kdnewsservice.GetKdNewsByNid(Int32.Parse(Request["_uid"]));
ViewData["xwnrList"] = xwnrList;
}
else
{
var xwnrList = _kdnewsservice.GetKdNewsByNid(zxdtList[0].Nid);
&nb