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

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

android - Keyboard hides my half of edit-text and button below it even in scroll view -

css - Make div keyboard-scrollable in jQuery Mobile? -