Showing posts with label postback. Show all posts
Showing posts with label postback. Show all posts

Wednesday, 19 March 2014

Capture Postback event Javascript ( Client side )

Capture Postback event Javascript:

Description:

        This piece of javascript code can intercept dopostback event in asp.net
        
        get the Dopostback event and call it after the AlwaysFireBeforeFormSubmit function. I used this code to show my overlay effect with progress bar and let the postback occurs.

Javascript:

<script type="text/javascript">
        var __oldDoPostBack = __doPostBack;
        __doPostBack = AlwaysFireBeforeFormSubmit;

        function AlwaysFireBeforeFormSubmit(eventTarget, eventArgument) {


            // Here we can add our function needed to execute before postback.


            return __oldDoPostBack(eventTarget, eventArgument);

        }
</script>

Relevant Post:

Overlay effect with jQuery and CSS