将ASPX线转换为Razor线

时间:2011-06-23 08:47:08

标签: asp.net-mvc razor

MVC新手......

以下行是我找到的示例代码,包含在ASPX页面中。

<URI><%=new Uri(Request.Url, 
    Response.ApplyAppPathModifier("~/user/authenticate"))%></URI>

如何将该行转换为放置在RAZOR视图中?

我的尝试......

<URI>@new Uri(Request.Url, 
    Response.ApplyAppPathModifier("/user/authenticate"))</URI>

谢谢

1 个答案:

答案 0 :(得分:3)

<URI>@(new Uri(Request.Url, Response.ApplyAppPathModifier("/user/authenticate")))</URI>

应该有用。