内部服务器错误500为什么我出错?

时间:2017-03-09 19:07:51

标签: jquery ajax asp.net-mvc

`` public JsonResult OutBox()
        {
            //int user_id = Convert.ToInt32(Session["schoolid"]);
            int user_id = 44;
            var data = db.SMS_Outbox.Where(x => x.schoolid == user_id).OrderByDescending(x => x.id).ToList();
            return Json(new { data = data }, JsonRequestBehavior.AllowGet);
        }

这是我的Action方法和Ajax调用它将返回此错误 GET http://localhost:54691/SMS/OutBox/OutBox 500(内部服务器错误)

function LoadOutBox() {
        debugger;
        $.ajax({
            url: "../OutBox/OutBox",
            async: true,
            type: "GET",
            success: function (data) {
              alert("Success");
            },
            error: function (data) {
                alert("fail");
            }
        });
    }

0 个答案:

没有答案
相关问题