Asp.net mvc 2 呈现视图时,如何访问当前URL

Asp.net mvc 2 呈现视图时,如何访问当前URL,asp.net-mvc-2,Asp.net Mvc 2,呈现视图时,如何访问当前url 也就是说, 当我访问时,我必须显示 “我的页面”中html部分的“索引”如果您在操作名称之后 未经测试,但大致如下: <%= this.ViewContext.RouteValues["action"] %> 有你需要的价值 <%= Url.Action("actionName", "controllerName") %> window.location

呈现视图时,如何访问当前url

也就是说, 当我访问时,我必须显示 “我的页面”中html部分的“索引”

如果您在操作名称之后 未经测试,但大致如下:

<%= this.ViewContext.RouteValues["action"] %>
有你需要的价值

<%= Url.Action("actionName", "controllerName") %>
window.location