Asp.net mvc 4 MVC中的默认路径问题
我无法在MVC中设置默认页面。我使用git hub的小写虚线路由作为url。当我打开我的项目,我得到404错误。当我打开localhost/home/index这样的页面时,它工作正常Asp.net mvc 4 MVC中的默认路径问题,asp.net-mvc-4,Asp.net Mvc 4,我无法在MVC中设置默认页面。我使用git hub的小写虚线路由作为url。当我打开我的项目,我得到404错误。当我打开localhost/home/index这样的页面时,它工作正常 using LowercaseDashedRouting; public class RouteConfig { public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{r
using LowercaseDashedRouting;
public class RouteConfig
{
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.IgnoreRoute("");
//routes.MapRoute(
// name: "Default",
// url: "{controller}/{action}/{id}",
// defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
// );
routes.Add(new LowercaseDashedRoute("{controller}/{action}/{id}",
new RouteValueDictionary(
new { controller = "home", action = "Index", id = UrlParameter.Optional }),
new DashedRouteHandler() ) ); }}}