asp.net mvc - 400 BadRequest Error And Custom Error Page -
i try have custom error page http error 404 page, add following in web.config. , can work.
<system.webserver> <httperrors errormode="custom" existingresponse="replace"> <clear /> <error statuscode="401" path="~/error/unauthorized" responsemode="executeurl" /> <error statuscode="403" path="~/error/forbidden" responsemode="executeurl" /> <error statuscode="404" path="~/error/notfound" responsemode="executeurl" /> <error statuscode="500" path="~/error/servererror" responsemode="executeurl" /> </httperrors> </system.webserver>
originally, request through web api , return error messages. after adding httperrors in web.config. returns "badrequest".
any idea of solve that?
thanks in advance
try:
<configuration> <system.webserver> <httperrors errormode="custom" existingresponse="replace"> <clear /> <error statuscode="401" path="~/error/unauthorized" responsemode="executeurl" /> <error statuscode="403" path="~/error/forbidden" responsemode="executeurl" /> <error statuscode="404" path="~/error/notfound" responsemode="executeurl" /> <error statuscode="500" path="~/error/servererror" responsemode="executeurl" /> </httperrors> </system.webserver> </configuration>
Comments
Post a Comment