Good evening Habr!
Recently started to learn ASP.NET MVC Framework and was faced with the following problem. Let's say I want to make a controller to search for a website of this type /search/<word>. But the user can type in the search anything, including /, and * and other special characters .NET is my feeling first translates the characters from the "encoding %" in the "normal view" and then determines what controller to pass.
Let the user enter a search in the "movies/games", the website will take a request like /search/%E8%E3%F0%FB%2F%F4%E8%EB%FC%EC%FB and that's the %2F will be first translated into " / " and the query in /search/movies/games and then will be determined by the controller. Accordingly, in my route defined as /search/{query}/{page} where page is restricted is either absent or consists of numbers, the query will not fall and the website will return a 404 error.
How to escape special characters?