远程请求MVC没有错误详细信息

时间:2017-01-05 13:44:06

标签: javascript ajax asp.net-mvc iis

我从我的MVC操作返回HTTPStatusCodeResult,该操作通过ajax调用。

return new HttpStatusCodeResult(System.Net.HttpStatusCode.BadRequest, "Msg Text");

然后在ajax错误函数中我想用JS读取我的自定义状态文本。

 error: function (xhr, status, error) {  }

本地(从服务器上安装的浏览器请求)一切正常,但使用远程机器时没有自定义消息文本。正如您在下面的ss中看到的那样,statusText或responseText中没有自定义消息(它在本地调用中存在)。 我也将这些行添加到我的web.config中,但它没有帮助:

<system.webServer>
   <httpErrors existingResponse="PassThrough" />
</system.webServer>
<system.web>
   <customErrors mode="Off" />
</system.web>

任何人都知道为什么IIS仍在阻止我的邮件? 提前谢谢。

xhr

0 个答案:

没有答案
相关问题