ASP.NET MVC: How to handle 400 bad request error when url end with %
问题 I am trying to handle all HTTP errors to my custom error pages, but I find that when there is a % at the end of url, i cannot use config setting or code to handle it, for example: http://localhost/abc% the response is: Bad Request - Invalid URL HTTP Error 400. The request URL is invalid. So, can we use config setting or c# code to handle this error request? 回答1: See this 4 part series for configuring custom error pages within IIS: http://www.dotnetscraps.com/dotnetscraps/post/Did-you-know