I'm trying to add a link to a page. The link should contain the current URL in a querystring (to be used as a ReturnUrl
) and it can contain a hash.
Middle-clicking, right-clicking and ctrl+clicking should be supported. For example, middle-clicking will open the link in a new tab with (or without) the querystring.
Is this completely off-track, or how can I improve it?
<a href="@Url.Action(MVC.Links.ThereAndBackAgain())?ReturnUrl=" onclick="this.href += encodeURIComponent(location.href)">