ASP code for opening links in new page?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • GGawaran
    New Member
    • Mar 2007
    • 24

    ASP code for opening links in new page?

    Ok, i figured since the <a href> code pretty much works the same on .asp, that by adding the target=_blank that it would open up in a new window, however when I do so, it give me an error on the _ character.

    What would I need to use?

    Thanks in advance everyone,

    Gregory Gawaran
  • AricC
    Recognized Expert Top Contributor
    • Oct 2006
    • 1885

    #2
    Originally posted by GGawaran
    Ok, i figured since the <a href> code pretty much works the same on .asp, that by adding the target=_blank that it would open up in a new window, however when I do so, it give me an error on the _ character.

    What would I need to use?

    Thanks in advance everyone,

    Gregory Gawaran
    What kind of error? What does your code look like? Are you using XHTML if so your attributes should be in quotes. You can use Javascript try this out

    Comment

    • GGawaran
      New Member
      • Mar 2007
      • 24

      #3
      Heres the code when asp doesn't like it.

      Code:
      				
      				if instr(invoice_tracking,"variable") then
      					invoice_tracking = "<a target="_blank" href=http://www.something.com>" & invoice_tracking & "</a>"
      				end if

      Comment

      • devsusen
        New Member
        • Feb 2007
        • 136

        #4
        Hi,
        u should write
        Code:
        if instr(invoice_tracking,"variable") then
              invoice_tracking = "<a target='_blank' href='http://www.something.com'>" & invoice_tracking & "</a>"
        end if
        Originally posted by GGawaran
        Heres the code when asp doesn't like it.

        Code:
        				
        				if instr(invoice_tracking,"variable") then
        					invoice_tracking = "<a target="_blank" href=http://www.something.com>" & invoice_tracking & "</a>"
        				end if
        susen

        Comment

        • chaitanya02
          New Member
          • May 2007
          • 46

          #5
          Originally posted by devsusen
          Hi,
          u should write
          Code:
          if instr(invoice_tracking,"variable") then
                invoice_tracking = "<a target='_blank' href='http://www.something.com'>" & invoice_tracking & "</a>"
          end if


          susen
          =============== =======

          You may also try with this:

          <a href="www.googl e.com" target="blank"> click here to open google website in a new page<

          Comment

          Working...