小编Eri*_*and的帖子

ASP.net MVC路由配置

我是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

3
推荐指数
1
解决办法
2894
查看次数

标签 统计

asp.net-mvc ×1