I have an asp.net app with an asp:button that causes a postback, this means that the html for the input has an onclick attribute that is auto generated, I need to add an event via jQuery to the onclick attribute that fires before the auto generated postback is fired.
Below is an example of the html generated, i need to make sure that my event added by jQuery fires before the WebForm_DoPostBackWithOptions() function.
<input id="ctl00_MainContent_Save" type="submit" onclick="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$MainContent$Save", "", true, "", "", false, false))" value="" name="ctl00$MainContent$Save">
for more clarity, I know I can add an event via jQuery like this:
$('#ctl00_MainContent_Save').click(function() {
somfunction();
});
but i want my event to fire before the WebForm_DoPostBackWithOptions