0

I have a page with several linkbuttons, and all of them is not working in Google Chrome. They are working well in IE and Firefox. Chrome Inspector can find the linkbutton and it has a javascript-postback attached for a postback call. The button is placed inside several panels, but that should not be the problem, or?

<asp:Panel runat="server" ID="pnlLike">
  <div class="singleRecept_Toolbar_Item">
    <asp:LinkButton ID="lnkBtnVote" runat="server" OnClick="VoteRecept">I like </asp:LinkButton>
    <asp:Image ID="imgVote" ImageUrl="/images/LCHF/likeIcon.gif" runat="server" Visible="true" />
  </div>
</asp:Panel>
M4N
  • 94,805
  • 45
  • 217
  • 260

4 Answers4

2

Add the following code to OnPreInit method of base page.

protected override void OnPreInit(EventArgs e)
{
    if (Request.UserAgent != null && (Request.UserAgent.IndexOf("AppleWebKit") > 0))  // added for compatibility issues with chrome 
    {
        this.ClientTarget = "uplevel";
    }

    base.OnPreInit(e);
}
Mischa
  • 42,876
  • 8
  • 99
  • 111
  • december 2012 update: with chrome desktop no need of this. But the bug seems to be there for chrome mobile (iphone chrome app) and this solution fixed it. Thank you. – firepol Dec 17 '12 at 14:07
0

Disabling the "Chrome Toolbox (by Google)" extension fixed the issue for me. If you don't have that extension still try disabling all your Chrome extensions.

When I had the issue, my first instinct was that it was incompatible Javascript provided by ASP but then I noticed the same exact issue on certain links here at Stackoverflow.

Also worth noting is that only the left click was broken - middle clicking links still opened them in a new tab.

sparebytes
  • 12,546
  • 3
  • 21
  • 32
0

You could try to open the JavaScript console in Chrome (Ctrl+Shift+j) and see if any errors are reported when loading the page or when clicking the buttons.

I've experienced problems with LinkButtons caused by totally unrelated JavaScript errors.

Tor-Erik
  • 990
  • 8
  • 25
  • When adding html-controls (not asp) they work fine. It must be some kind of asp.net-chrome problem. Weirdly I have a lot of asp controls on the same page that is working. So this is not a specific LinkButton problem, I have no postbacks at several asp controls on the page –  Aug 11 '09 at 12:10
0

If this works in other browsers and not chrome, then you should file a bug here.

Paul Wicks
  • 62,960
  • 55
  • 119
  • 146