2

在运行应用程序时,我在Application_Error处理程序中得到异常:

The controller for path '/Content/images/ui-bg_glass_65_ffffff_1x400.png' was not found or does not implement IController.

谁能解释一下,为什么Image 路径解释MVC Action

MVC路由器正在搜索等效控制器

这种行为真的很奇怪。任何帮助,将不胜感激。

4

1 回答 1

2

我认为这是因为您的文件系统中不存在图像(IIS 首先检查文件系统中的静态内容)。尝试在 global.asax 路由注册中使用下一个代码:

protected void Application_Start()
{
    RegisterRoutes(RouteTable.Routes);
}
public static void RegisterRoutes(RouteCollection routes)
{
    routes.IgnoreRoute("/Content/{*path}");
}
于 2012-06-20T06:46:37.353 回答