【发布时间】:2013-05-03 13:28:21
【问题描述】:
我正在尝试执行以下操作:
public class RouteConfig
{
public static void RegisterRoutes(RouteCollection routes){
{
//other stuff
routes.MapRoute(
name: "MyRoute",
url: "test.htm",
defaults: new { controller = "Controller", action = "Test" });
}
}
但 IIS 在尝试检索 example.com/test.htm 的静态文件时返回 404。
怎样才能得到想要的效果?
【问题讨论】:
-
另外,我尝试将它放在
RegisterRoutes方法的顶部。结果还是一样。
标签: asp.net-mvc iis asp.net-mvc-routing