Reputation: 1369
I have created an ASP.net 5 MVC6 project and added the following:
app.UseStatusCodePages();
inside my Configure method. If I run the application, open my web browser and navigate to the following URL:
ASP Displays a 404 error message which is the expected behavior. If I navigate to an even longer invalid URL such as:
I now get the following:
Bad Request - Invalid URL
If you navigate to the equivalent MSDN URL you get the same result. However If you navigate to the equivalent stackoverflow URL it is somehow handled. How are they handling this? and how can this be done in ASP.net MVC6?
Upvotes: 0
Views: 461
Reputation: 888
Are you getting a 404.15 ? it might be that the query string length is too long for IIS . Check this https://www.iis.net/configreference/system.webserver/security/requestfiltering/requestlimits
Try changing the maxQueryString attribute in thr requestLimits section in web.config to see if it helps.
Upvotes: 0