asp.net mvc - MVC5 Cannot return custom 404 error with JsonResult -
i cannot return custom json result below when publish mvc5+angular2 project iis. return default iis 404 error html.
response.statuscode = 404; return json(myerrorobject, jsonrequestbehavior.allowget);
everything works fine whil developing project using iis express.
thanks.
if want return json custom 404 or http message, need set config below;
<system.webserver> <httperrors existingresponse="passthrough"/> </system.webserver>
Comments
Post a Comment