c# - How to register a route that admits a dot in the path? -
i want implement routing system admits dot in url. handle urls like:
mydomain/user/details/raguilar
but if username has dot, generated as:
mydomain/user/details?username=r.aguilar
i tried add following route:
routes.maproute( name: "users", url: "user/{action}/{username}", defaults: new { controller = "user", username = urlparameter.optional }, constraints: new { username = @"\w+\.?\w+" } ); and seems ok, when clicked on url received error says related resource not found or that.
is there way fix issue?
in order solve problem should add following line system.webserver/handlers element:
<add name="apiuris-isapi-integrated-4.0" path="/user/*" verb="get,head,post,debug,put,delete,patch,options" type="system.web.handlers.transferrequesthandler" precondition="integratedmode,runtimeversionv4.0" /> where user controller belong paths contain dot.
Comments
Post a Comment