[HttpPost]
public ActionResult accountchange(int id, int accountid, bool activate)
{
// Operations
return Json(new { Model = model, Result = true, Message = "Changed Successfully });
}
$('#accountchange-button').click(function() {
alert("");
$.post("url/accountchange/", {id:1, accountid:1, activate:1},
function (data) { $('.result').html(data); }, "json");
});
總是有:後總是得到HTTP錯誤500:ASP.NET MVC3
POST http://localhost/account/accountchange/ 500 (Internal Server Error)
f.support.ajax.f.ajaxTransport.sendjquery.min.js:4
f.extend.ajaxjquery.min.js:4
f.each.f.(anonymous function)jquery.min.js:4
(anonymous function)demo:105
f.event.dispatchjquery.min.js:3
f.event.add.h.handle.i
什麼想法?
您應該在Chrome開發人員工具或Firebug中查看完整的XMLHttpRequest響應。來自服務器的響應將比HTTP狀態代碼具有更多信息。 – jaredhoyt
500是內部服務器錯誤 - 您的服務器錯誤日誌說什麼? –
謝謝jaredhoyt,我將用螢火蟲進行調試 – gandil