asp.net mvc does not receive the GET request with a period in it

Viewed 1581

I'm using .net4.5rc with MVC4.0rc

The code below is taken from a MVC webapi application but I the same behaviour is there for reular asp.net mvc

My registerroutes code looks like this

 routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            routes.MapHttpRoute(
                name: "R1",
                routeTemplate: "product/{id}",
                defaults: new { 
                                controller="Product",
                                id = RouteParameter.Optional 

                              }
            );

This works well with Ids that doesn't have a period in them. However when I ask for a product with a period in it, the call does not seem to get to ASP.NET

when I use the setting below as suggested on similar posts it works when there is a trailing / But it doesn't work without it

in summary

http://mysite.com/product/AZ0     //works
http://mysite.com/product/AZ.0/   //work with relaxedUrlToFileSystemMapping
http://mysite.com/product/AZ.0    //does not work

The response is 404 and I guess this is returned by IIS without involving ASP.NET. When I run routedebugger with a URL like the last one above, I don't even get the routedebugger stuff

How do I make IIS to pass the control to ASP.NET when there is a URL with a pattern: mysite.com/product/{id} regardless of whether there is a period in the id or not.

thanks.

1 Answers
Related