Actionlink opens a new window

Topics: Troubleshooting, Writing modules
Mar 1, 2012 at 7:18 PM


Is it possible to open a actionlink into a new browers window?, I got the following code, but its just opening a new tab in the current brower, kinda new to MVC and don´t realy get how pass throw a action and route value to a in a regular javascript. Can someone point me in some direction?


@Html.ActionLink("GetDetalis", "Home", new { id = }, new {target = "_blank"})

Mar 1, 2012 at 7:45 PM

Try asking Google first: I'm sure you'll find the answer ;)

Mar 2, 2012 at 12:52 PM

Lol, either you did something wrong, or unearthed a bug : your link links to '' :P

Mar 2, 2012 at 1:05 PM
Edited Mar 2, 2012 at 1:06 PM

Whoops, seems like the + character doesn't work ;)

Long story short: just use '_new' instead of '_blank', and you're good to go (although I didn't actually test it; I got it from this site:


Mar 4, 2012 at 2:21 PM

well, _new acts just the same as _blank, just opens a new tab in the current browser, atleast it does in EI8. 

Mar 4, 2012 at 3:39 PM
Edited Mar 4, 2012 at 3:40 PM

I'm afraid you're out of luck:

On the other hand, it's quite easy for a user to open a link in a new window by clicking the right buttons. Perhaps it even makes sense that a user should be the one deciding whether or not he wants to open a new page in a new indow or a new tab, instead of the page author?