Thursday, November 3, 2016

Make a Razor ActionLink open the link's URL up in a new tab.

@Html.ActionLink("touch me", "Index", "Home", null, new { target = "_blank" })

 
 

do NOT do this instead...

@Html.ActionLink("touch me", "Index", "Home", new { target = "_blank" })

 
 

...as this will make ?Length=4 appear at the end of the URL at the new tab.

No comments:

Post a Comment