ASP.NET and jQuery submit event
ASP.NET has the concept of postbacks (for example, for LinkButtons), that can be a problem if you want to subscribe to the submit event with jQuery:
$('form').submit(function() {});
With postbacks, there is no submit event. ASP.NET has a javascript method __doPostBack that handles the calls to the server. That's why I wrote a jQuery plugin (http://plugins.jquery.com/beforePostBack/) to subscribe to the (new) beforePostBack event:
$.beforePostBack(function() {});
The plugin can be found here: https://github.com/petermorlion/jquery.beforePostBack
Written by Peter Morlion
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Javascript
Authors
Did you know?
JavaScript on a page runs with the privileges of that origin. One altered library, tag manager, or snippet can read inputs, change what people see, and call your APIs as the user.
Security insights from Cside
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#