开发者

Convert ASPX line to Razor line

开发者 https://www.devze.com 2023-03-15 07:44 出处:网络
New to MVC... The following line is in a sample code I found and is contained in an ASPX page. <URI><%=new Uri(Request.Url,

New to MVC...

The following line is in a sample code I found and is contained in an ASPX page.

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

How would that line be converted 开发者_如何学运维to be placed in a RAZOR view?

My attempt...

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

thank you


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

should work.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号