I tried almost all the links and solution on google first page . but all the answers led to me in new tab instead of new window. While i want to open ActionLink in new window . Please provide something other than target = "_blank"
Asked
Active
Viewed 3,529 times
2
-
Show the code from which you want to open the window – Mairaj Ahmad Jul 07 '15 at 07:48
-
whats wrong with target = "_blank" if it produces the intended effect? – Krishna Jul 07 '15 at 07:48
-
1possible duplicate of [JavaScript open in a new window, not tab](http://stackoverflow.com/questions/726761/javascript-open-in-a-new-window-not-tab) – Paul Zahra Jul 07 '15 at 07:50
-
This behavior depends on Browser preferences of user. You cannot control it from JavaScript. – ramiramilu Jul 07 '15 at 07:54
2 Answers
2
You can try the below code
<a href="#" onclick="openNewWindow();">open</a>
<script type="text/javascript">
function openNewWindow() {
window.open("/values/index", "New Window", "height=500,width=500");
}
</script>
In the url assume Values is your controller and Index as your action
Hope this helps!!

Umamaheswaran
- 3,690
- 3
- 29
- 56
1
to be sure to open a new window without target=_blan
k (which will open a new tab), you might have to use some js. It will be difficult to achieve it only with HTML as all browser uses tabs nowadays.
try: window.open("http://mynewwindowurl")
<button onclick="myFunction()">Open in a new window</button>
<script>
function myFunction() {
window.open("http://mynewwindowurl.com");
}
</script>
details: http://www.w3schools.com/jsref/met_win_open.asp
hope it helps
also check this link for js window open with specs: JavaScript open in a new window, not tab