I have a Labels controller and its action
public ActionResult ShowLabel(string label) it should display tags. I want to prescribe a route for this action, I register it like this
routes.MapRoute( name: "ShowLabel", url: "Label/{label}", defaults: new { controller = "Labels", action = "ShowLabel" } ); Everything works with labels like C# , kkk and others without a dot. But with the label ASP.NET does not work and gives an error 404. So I understand it does not work due to the fact that there is a dot in the tag name, if it doesn’t work for other tags with a dot, it also does not work. It is not clear why it does not work, and how to make it work so that it would work with a dot. Performance in general with such labels does not enter.
Here is an example URL
http://localhost:58791/Label/тег3- workshttp://localhost:58791/Label/С#- workshttp://localhost:58791/Label/ASP.NET- does not work
And if the default routes everything works with any labels. http://localhost:58791/Labels/ShowLabel?label=ASP.NET - works if you don’t make a ShowLabel route.
I tried to write restrictions:
routes.MapRoute( name: "ShowLabel", url: "Label/{label}", defaults: new { controller = "Labels", action = "ShowLabel" }, constraints: new { label = @"[.#\-+_$@\w]+" } ); the same result.
Checked, also for + does not work in the name, but for - works.
I tried to add the same settings
<system.webServer> <security> <requestFiltering allowDoubleEscaping="true" /> </security> </system.webServer> + earned as well never works.