11

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?

4

2 回答 2

5

只需在 URL 末尾添加一个斜杠“/”:www.xxx.yy/pages/filter/test./

请参阅:URL 中的点会导致 404 与 ASP.NET mvc 和 IIS

于 2016-02-12T13:03:39.190 回答
2

看看这篇文章:“找不到资源。” url 末尾有“点”时出错

于 2009-01-11T23:26:51.027 回答