back soft

مطالب مرتبط با «asp net mvc jsonresult return error» در back soft | نویسنده: استخدام کار

ASP.NET MVC JsonResult not returning responseText in jQuery.post fail callback function

Vote count: 0 I am using jQuery $.post to post some data to an ActionResult method inside my controller. When an error is thrown in the controller, it should retu the error message within the responseText of the response but it's not working. The callback function fail seems to be triggered. Just not getting the error message retued. Not sure what I am doing wrong? This is jQuery posting data: var postData = ["1","2","3"]; $.post('/MyController/GetSomething', $.param(postData, true)) .done(function (data) { alert('Done!'); }) .fail(function (xhr, textStatus, errorThrown) { alert(xhr.responseText); //xhr.responseText is empty }); }); Controllers public class MyController : BaseController { pu...

ادامه مطلب

برچسب‌های مرتبط

asp net mvc jsonresult | asp net mvc jsonresult example | asp net mvc jsonresult return error | asp net mvc jsonresult date format | asp net mvc jsonresult datetime | asp net mvc jsonresult camelcase | asp net mvc jsonresult anonymous object | asp net mvc jsonresult error handling | asp net mvc jsonresult file download | asp net mvc jsonresult array