通常、ルートはGlobal.asaxファイルの RegisterRoutes メソッドで定義されます。
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
"Export", // Route name
"Export/{action}/{table}", // URL with parameters
new { controller = "Export", action = "AsExcel", table = "" } // Parameter defaults
);
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Home", action = "Index", id = "" } // Parameter defaults
);
}
上記のような定義を使用すると、既定のアクションがAsExcelになるように、 ExportControllerに別のルートを使用できます。
あなたが説明したルートの場合、エリアがMVCパターンの一部であるかどうかはわかりません。
それでも価値があるので、複雑なルートを持つこのスレッド ASP.Net MVCからいくつかの利点があるかもしれません
- How to keep it "sane"?