2

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"

Konamiman
  • 49,681
  • 17
  • 108
  • 138
Mani
  • 2,391
  • 5
  • 37
  • 81

2 Answers2

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=_blank (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

Community
  • 1
  • 1
Raphael_b
  • 1,470
  • 3
  • 16
  • 30