我是MVC的新手,所以我遇到了一些问题,想知道如何为以下场景设置我的路线.
假设我有一个查找航班数据的站点,并显示每个航班的三个主要视图.
我希望URL结构如下:
www.domain.com/<flightnumber>/ <-- Main page for the flight
www.domain.com/<flightnumber>/crew <-- A page with details of the crew for that flight
www.domain.com/<flightnumber>/destination <-- details of the destination for the flight
Run Code Online (Sandbox Code Playgroud)
因此,基本上查找键是域之后的第一个项目.URL的任何后续部分都映射到该航班的特定视图.
看似简单,但我似乎无法弄清楚如何构建控制器和路线...
asp.net-mvc ×1