Programmatically open a new tab in ie7

I am developing web applications with C #, Aspnet 3.5 and Ajax 2.0.

Question. I am running Application_1 in ie7. I would like to programmatically run Application_2 from Application_1 in a new tab, no matter what client settings.

So far, I open Application_2 in a new window from Application_1, using

ScriptManager.RegisterStartupScript(this, typeof(Page), UniqueID, "window.open('theurl',' width=800, height=500'); ", true); 

I would like to do something similar to open a new tab.

+4
source share
3 answers

Unfortunately, there is no way to control whether a window opens in a new tab or in a new window. This is a custom parameter that cannot be overridden in code.

+8
source

Here's a Microsoft rationale for you, if you're interested.

“As for the script, there is no“ target = '_ tab ”function or any direct access to tabs from the script beyond what is available in several windows today. We are working on balancing the default behavior so that the window opened from the script opens both in the new frame and in the bookmark.

You can tell your user that by holding ctrl + shift and clicking on the link, a new tab will open.

+5
source

As Paul already noted, this cannot be done with any script or code.

I think that it is best to allow your users (through their individual browser settings) how they want to open a new page - in a new window or on a new tab in the same window.

+1
source

All Articles