Opening a hyperlink in a new tab in ASP.NET

后端 未结 6 1370
失恋的感觉
失恋的感觉 2021-01-01 18:50

I have a hyperlink on my page and I would like it to automatically open in a new tab when clicked, how would I do this? If this is not possible I will accept new window.

相关标签:
6条回答
  • 2021-01-01 19:04

    The syntax is following:

    <a href="http://www.someurl.com" target="_blank">
    

    This will open the page in new page or tab this depends on browser configuration.

    0 讨论(0)
  • 2021-01-01 19:06

    Use the following

    <asp:HyperLink ID="hplStandard" runat="server"  ForeColor="Green"  
     Font-Bold="True" Target="_blank">Standard Report</asp:HyperLink>
    
    0 讨论(0)
  • 2021-01-01 19:10

    add

     target="_blank" in your link. 
    

    If you want links on whole page to be open in new tab you can use.

    <head>
     <title></title>
     <base target="_blank"/>
    </head>
    
    0 讨论(0)
  • 2021-01-01 19:14

    CSS3 offers a target-new property for which you can specify window | tab | none:

    If a user wanted to have new windows open in new tabs instead, she could use the following user style sheet to do so:

    * { target-new: tab ! important }
    
    0 讨论(0)
  • 2021-01-01 19:28

    This depends on how the browser treats the target attribute on the a (anchor) tag

    When target="_blank", older browsers, which don't have tabbing, will open a new window.

    Newer browsers, however, will use this to open a new tab.

    0 讨论(0)
  • set the property Target to _blank

    0 讨论(0)
提交回复
热议问题