How to show same text as hyperlink to other new tab page?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Molham

    How to show same text as hyperlink to other new tab page?

    How to show same text as hyperlink to other new tab page?

    Code:
    <%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default2.aspx.vb" Inherits="Default2" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
        
            <a href="Default.aspx">Show My Name in other window by clicking on me</a></div>
        </form>
    </body>
    </html>
    Last edited by Frinavale; Nov 19 '10, 02:03 PM. Reason: Added the question to the thread. Please use [CODE] [/CODE] tags when posting code
  • Molham

    #2
    emmmm

    like if you want to click on this hyperlink the content of this hyperlink(Show My Name in other window by clicking on me) will displayed in the other page

    Comment

    • jeffstl
      Recognized Expert Contributor
      • Feb 2008
      • 432

      #3
      Not sure I should answer this. There are plenty of ways to do this, if I understand what your saying correctly.

      First you simply set the target properly of your <a href> with

      Code:
      <a href="Default.aspx?title=WhateverYouWant" target"_blank">
      Next, well you can either use session variables or just pass a query string if you want to dynamically change the new windows title. Once you have your desired title, put it in a

      Code:
      <asp:Literal>
      control that you place in your <title></title> on the next page.

      Then just make sure you set your literal during the Page_Load event.

      Code:
      MyLiteralControl.Text = Request.QueryString("title")

      Comment

      Working...