下面是一个路由设置,但是如果路由A,路由B,路由C都设置的话,在执行路由B的controller时,就会报错,把路由A注释掉,就可以正常执行路由B,不知道是不是路由C设置的问题,这里路由A是要接收2个参数.//路由A
MapRoute(
"NewsList",
"News/List/{TypeId}/{IsGlobal}",
new { controller = "News", action = "List" }
);//路由B
MapRoute(
"DefaultTheme", // Route name
"{Theme}", // URL with parameters
new { controller = "Home", action = "Index" } // Parameter defaults
);//路由C
MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Home", action = "LogOn", id = "" } // Parameter defaults//LogOn
);
MapRoute(
"NewsList",
"News/List/{TypeId}/{IsGlobal}",
new { controller = "News", action = "List" }
);//路由B
MapRoute(
"DefaultTheme", // Route name
"{Theme}", // URL with parameters
new { controller = "Home", action = "Index" } // Parameter defaults
);//路由C
MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Home", action = "LogOn", id = "" } // Parameter defaults//LogOn
);
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货