我只是无法得到这个工作...... 我有以下途径:ASP.net MVC路由资源
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.IgnoreRoute("*.html|js|css|gif|jpg|jpeg|png|swf");
routes.IgnoreRoute("{*favicon}", new { favicon = @"(.*/)?favicon.ico(/.*)?" });
routes.MapRoute(
"Default", // Route name
"{lama}/{controller}/{action}", // URL with parameters
new { controller = "Home", action = "Index", lama = "en-gb" } // Parameter defaults
);
而且一旦我加载页面..我有试图以检索一个img元素以下网址: CSS/IMG /背景/ slide1_2048x1280.jpg
但图像不会显示出来,如果我检查我的控制台我得到以下错误: GET {我的本地}/CN /主页/ CSS/IMG /backgrounds/slide1_2048x1280.jpg 404(Not Found)
我很难理解路线系统..在那里我可以读更多ALOT更多关于这个?..有人可以帮助我解决这个问题,那么非常感谢!
开箱即用,MVC项目模板的默认路由不会干扰映射到物理存在文件的URL。你在那里有'routes.RouteExistingFiles = true'吗? – 2012-08-06 14:03:53
嗯...因为一些奇怪的原因,它似乎现在工作..:/ ... – Inx 2012-08-06 14:14:33
一定是其他一些奇怪的问题..因为如果我访问{我的本地主机}/en-gb ..一切都很好..但如果我要访问{my localhost}/en-gb/Home/Index,图像不见了。 – Inx 2012-08-06 14:16:23