axnst2
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:
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.
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" })
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.
many browsers can override your settings and enforce opening in a new tb vs new window
ASKER
I'm targeting IE.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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.
Either way the effort deserves the points.