0
在我的site.master中,我需要能够重写当前路由以匹配移动站点。如何用新的路由数据值重写asp.net mvc中的当前路由
基本上我需要能够做到这一点:
<%= Url.RouteUrl("home", new { controller = "Home", action = "Index", environment = "d1" })%>
,但我需要知道路线名称和值在每个页面请求
在我的site.master中,我需要能够重写当前路由以匹配移动站点。如何用新的路由数据值重写asp.net mvc中的当前路由
基本上我需要能够做到这一点:
<%= Url.RouteUrl("home", new { controller = "Home", action = "Index", environment = "d1" })%>
,但我需要知道路线名称和值在每个页面请求
Jousterling
如果有些人还是想知道如何做到这一点,显然你不能从菲尔哈克得到路线名称
:
http://haacked.com/archive/2010/11/28/getting-the-route-name-for-a-route.aspx
但您可以使用路由名称注册数据令牌,然后再提取。