当前位置: 动力学知识库 > 问答 > 编程问答 >

asp.net - Dot Net Nuke Ajax call to file.ashx on site root returns 404 error

问题描述:

I am posting to a file using ajax in DNN 7.1. The .ashx is on the site root outside of the portals directory. The response is a 404 error and the URL is rewritten to ...com/cart/undefined. I can however put in the following www.mysite.com/cart/cart.ashx and get the expected response.

EDIT

This started by trying to use a .ashx file to call an API. Same code on another site returns 400 with a detailed error message. On the current site the file returns 400 BadRequest and nothing else.

网友答案:

Finally resolved this issue:

    Response.TrySkipIisCustomErrors = true;

http://msdn.microsoft.com/en-us/library/system.web.httpresponse.tryskipiiscustomerrors(v=vs.110).aspx

分享给朋友:
您可能感兴趣的文章:
随机阅读: