wildcards in asp.net mvc routes

匿名 (未验证) 提交于 2019-12-03 03:04:01

问题:

i'm using asp.net mvc with vs2008 and IIS7. What i want to accomplish is that all requests that START WITH 'summer' are routed to the same controller. 'till now i've built tons of routes, but they were all for one path (with parameters offcourse) but this one must route: www.mysite.com/summercity www.mysite.com/summermadness www.mysite.com/summer www.mysite.com/summerweather

to the same controller.

the only solution i've come up with is 'summer*', but that didn't work :)

Michel

回答1:

You can use:

/Summer{*Data} 


标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!