on right click on LinkButton if we chose to "Open in new tab/window " it doesn't work
-
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
-
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
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?