[英]Open URL in new tab instead of window using c# code behind
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, 如果您要使用Button,然后像这样标记您的按钮定义,
<asp:Button ........OnClientClick="NameofForm.target ='_blank';"/>
in code behind use redirection 在使用重定向后面的代码中
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: 用户通过身份验证后,添加一个会话变量以确认身份验证,使用该会话变量检查用户是否通过了身份验证,如果通过了身份验证,则将javascript代码编写为:
window.open("http://www.yahoo.com"); window.open( “http://www.yahoo.com”);
So, after your page is refreshed post authentication, the window will open. 因此,在验证后刷新页面后,将打开该窗口。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.