Link to home
Start Free TrialLog in
Avatar of axnst2
axnst2Flag for United States of America

asked on

Open MVC5 View in new Window (not Tab) using HTML.ActionLink

Hi Experts,

   I would like to be able to open an MVC5 View in a new window (NOT TAB) using HTML.ActionLink.  I know I can do it using JavaScript and Route Configuration, but I need to pass to the View a complex object which is not possible using Route Configuration.  I tried using the below but they all just open the view in a new Tab of the same window:

@Html.ActionLink("Link Text", "Action", "Controller", new { var1 = value1 }, new { target = "Parent" })

Open in new window


For target I've tried using '_blank', 'New Window', 'Parent', 'Top', 'Self', but they all just open it in a new Tab instead of a new Window.
Avatar of David Johnson, CD
David Johnson, CD
Flag of Canada image

many browsers can override your settings and enforce opening in a new tb vs new window
Avatar of axnst2

ASKER

I'm targeting IE.
SOLUTION
Avatar of David Johnson, CD
David Johnson, CD
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of axnst2

ASKER

I have no problem opening a new window using JavaScript so there must be a way to do it without changing that IE setting.  If I change that setting, I affect other links in a way that I don't intend to.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of axnst2

ASKER

This did not solve my problem, but resulted in me having to have to go about doing this a whole different way.  It's really sad that MVC5 is not capable of doing something so simple.  The JavaScipt route is what I am replacing it with but that causes issues because now I can't pass my complex object to the controller.

Either way the effort deserves the points.