问题
I am using asp.net webform. In my application, I show user page like http://localhost/username
In RouteConfig.cs I register routes like this:
routes.MapPageRoute("default", "", "~/default.aspx");
routes.MapPageRoute("user", "{id}", "~/user.aspx");
routes.MapPageRoute("search", "search/{id}", "~/search.aspx");
but when a username contains point (.) it shows 404 error.
http://locahost/name.lastname this shows error.
Any hint? Thanks
回答1:
I thought it was related with extensions. So, I found an answer about this. ASP.NET Webforms routing with extension
I add this to web.config
<modules runAllManagedModulesForAllRequests="true" />
<handlers>
<remove name="UrlRoutingHandler" />
</handlers>
and it is worked!
来源:https://stackoverflow.com/questions/31514230/routes-mappageroute-does-not-work-with-point