0
我有兩條非常簡單的路由。一個工作並將第一個參數(年)傳遞給控制器,另一個將參數作爲「文本」發送。我只是不明白。路由不能做什麼我期望在ASP.NET中使用MVC4路由
下面是我定義的兩條路線。它們在形狀上看起來與我完全相同。
控制器只是..
public ActionResult Index(string year)...
// SESSIONS
routes.MapRoute("SessionRouteAll", "Session/{year}",
new
{
/* Your default route */
controller = "Session",
action = "Index",
year = currentYear
});
// SPEAKERS
routes.MapRoute("SpeakerRouteAll", "Speaker/{year}",
new
{
/* Your default route */
controller = "Speaker",
action = "Index",
year = currentYear
});