user1562231
user1562231

Reputation: 251

Open URL in new tab instead of window using c# code behind

Upvotes: 2

Views: 2552

Answers (2)

SHAKIR SHABBIR
SHAKIR SHABBIR

Reputation: 1295

When user is authenticated, add a session variable to confirm authentication, use that session variable to check whether the user is authenticated or not and if authenticated, write a javascript code as:

window.open("http://www.yahoo.com");

So, after your page is refreshed post authentication, the window will open.

Upvotes: 0

joshua
joshua

Reputation: 2371

if you are using Hyperlink then use Target Attribute

Behavior for Target Attribute is depend on Browsers

 target="_blank"

older browser --> In New Window cause No tabbing Support.

Newer browser---> new Tab.

and if You Want you use Button then markup your button definition like this,

<asp:Button ........OnClientClick="NameofForm.target ='_blank';"/>

in code behind use redirection

Upvotes: 1

Related Questions