Search code examples
javascriptasp.net.netpostbackadblock

Adblock preventing button from being clicked


I'm not able to click on my LinkButton in FireFox when I have either of the following extensions enabled:

  • AdBlock Plus
  • Disconnect

Any idea why this could be happening and what I could do to get around it? I've tried CausesValidation ="false" to no avail. It seems like the javascript:__doPostBack() function is just never called when these extensions are enabled.


Solution

  • Here's a fuller answer, but I had a click event binding to my LinkButton looked like this:

    $(anchorEl).click(function () { 
                        ga('send', 'event', 'outbound', 'click', anchorEl.href, {
                            'hitCallback':
                              function () {
                                  document.location = anchorEl.href;
                              }
                        });
                        return false;
                    }); 
    

    Because of this the Javascript on the LinkButton was getting completely ignored and the __doPostBack() was not firing.