0

I want to be able to prevent this postback without actually editing the HTML itself.

<a class="button campaign-button" id="ctl00_main_fastcheckout_FastCart_FastDiscount_lbDiscountCode" href="javascript:__doPostBack('ctl00$main$fastcheckout$FastCart$FastDiscount$lbDiscountCode','')"><span>OK</span></a>

Is there a default way of disabling postbacks perhaps on document load?

Thanks :)

2 Answers2

0

You can always use return false.

OnClientClick="yourFunction(); return false;"

In js:

yourFunction(){
    //code
    return false;    
}
Alex Char
  • 32,879
  • 9
  • 49
  • 70
0

Try this Java script on your page

window.__doPostBack = function(eventTarget, eventArgument) {
return false;
};

But this is not the recommended way.

check out thishow-does-the-dopostback-method-get-called-where-is-the-calling-method

Community
  • 1
  • 1