Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 773
michal zygula Avatar asked Jan 10 '09 23:01

michal zygula


2 Answers

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.

like image 176
romanoza Avatar answered Sep 28 '22 05:09

romanoza


Have a look at this post: "The resource cannot be found." error when there is a "dot" at the end of the url

like image 30
Charlino Avatar answered Sep 28 '22 04:09

Charlino