1 回答

TA貢獻1839條經驗 獲得超15個贊
樓主可以在global里做如下設置
public class MvcApplication : System.Web.HttpApplication
{
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute(".axd/");
routes.MapRoute(
"xiaohong", // Route name
"Home/xiaohong", // URL with parameters
new // Parameter defaults
);
routes.MapRoute(
"chenghong", // Route name
"Home/chenghong", // URL with parameters
new // Parameter defaults
);
routes.MapRoute( //注意Default一定要寫到最后
"Default", // Route name
"//", // URL with parameters
new // Parameter defaults
);
}
protected void Application_Start()
{
AreaRegistration.RegisterAllAreas();
RegisterRoutes(RouteTable.Routes);
}
}
- 1 回答
- 0 關注
- 431 瀏覽
添加回答
舉報