I've a view page in which there's an HTML ActionLink. Now on click of that action link, i want to open a new popup window without closing the previous one. In this new popup window i want to show my existing view page. please provide me a better solution.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Specify the HTML 'target' attribute using the htmlAttributes
parameter. In Razor:
@Html.ActionLink("New Window", "Index", null, new { target= "_blank" })
In ASPX syntax:
<%= Html.ActionLink("New Window", "Index", null, new { target= "_blank" }) %>
回答2:
Could not get the answers on here to work. I had to use
<%= Html.ActionLink("New Window", "Index", null, new { .target= "_blank" }) %>
This worked for me. It was just the silly little period at the beginning of target that was missing.