【发布时间】:2009-02-16 22:55:47
【问题描述】:
我有一个类似的路由表
// Allow browsing categories by name, instead of by ID.
routes.MapRoute("Categories", "Categories/{action}/{name}",
new { controller = "Categories", action = "Index", name = "" }
);
// All other pages use the default route.
routes.MapRoute("Default", "{controller}/{action}/{id}",
new { controller = "Applications", action = "Index", id = "" }
);
// Show a 404 error page for anything else.
routes.MapRoute("Error", "{*url}",
new { controller = "Error", action = "404" }
);
但是最后的通配符路由没有被调用...如果我输入一个不存在的控制器或 URL,它会尝试通配符路由上方的默认路由...从而导致找不到 ASP 的信息资源。网络错误页面...我想要一个自定义错误页面...请帮助
【问题讨论】:
标签: asp.net asp.net-mvc