Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. on right click on LinkButton if we chose to "Open in new tab/window " it doesn't work

on right click on LinkButton if we chose to "Open in new tab/window " it doesn't work

Scheduled Pinned Locked Moved ASP.NET
csharphelpasp-netbusinesstutorial
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Y Offline
    Y Offline
    yogita charhate
    wrote on last edited by
    #1

    hello, I got one bug in my site developed using C# and asp.net If we right clicked on the LinklButton We get Options like "Open in new window and Open in new Tab" in case of IE (7.0). But when we select one of them, say tab,then page doesn't open actually in new tab but it opens in the same tab. same if we selectd open in new window it opens in the same window. Moreover in case of Mozilla Firefox browser we don't even get options like "Open in new window and Open in new tab". If we use Hyperlink then both these options work fine on both the browsers. But Hyperlink control doesn't have Click event so we can't use it. So two meet both the requirements what to do. Hope you undrstood my problem. Please guide. Thank you.

    yog hui gfgh kgdgrt njjn hjgkn

    B 1 Reply Last reply
    0
    • Y yogita charhate

      hello, I got one bug in my site developed using C# and asp.net If we right clicked on the LinklButton We get Options like "Open in new window and Open in new Tab" in case of IE (7.0). But when we select one of them, say tab,then page doesn't open actually in new tab but it opens in the same tab. same if we selectd open in new window it opens in the same window. Moreover in case of Mozilla Firefox browser we don't even get options like "Open in new window and Open in new tab". If we use Hyperlink then both these options work fine on both the browsers. But Hyperlink control doesn't have Click event so we can't use it. So two meet both the requirements what to do. Hope you undrstood my problem. Please guide. Thank you.

      yog hui gfgh kgdgrt njjn hjgkn

      B Offline
      B Offline
      badgrs
      wrote on last edited by
      #2

      The LinkButton isn't strictly speaking a normal hyperlink, it runs some javascript in the onlick event that causes the form to post back. Firefox correctly realises this and doesn't give you the "open in new tab" option, and in IE it doesn't work because there is no link to open, only the code to run when its clicked (which it what happens). Short answer is that "open in new tab" will only work for navigational links (ie ones that actually point to another URL). The ASP HyperLink control doesn't have a click event because its supposed to be used for naviation, although if you use an HTML <a> tag with runat="server" you will get an onserverclick event (which basically turns it into a LinkButton). What are you trying to use the LinkButton for? Are you running some code in the Click handler or just redirect?

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups