michal zygula
michal zygula

Reputation: 183

asp.net mvc routing when passed parameter contains dot

I have very basic routing:

routes.MapRoute(
                "Default",                                              
                "{controller}/{action}/{id}",parameters
                new { controller = "Home", action = "Index", id = "" }
            );  

The problem is that it works perfectly in all simple cases, like www.xxx.yy/pages/filter/test". As soon as I add dot "." to {id} part it fails, returning 'The resource cannot be found.' It happens for www.xxx.yy/pages/filter/test.

Any suggestions?

Upvotes: 11

Views: 6853

Answers (2)

romanoza
romanoza

Reputation: 4862

Just add a slash "/" at the end of the URL: www.xxx.yy/pages/filter/test./

See: Dots in URL causes 404 with ASP.NET mvc and IIS.

Upvotes: 5

Related Questions