AJAX Animation and timeouts

Joined
May 5, 2010
Messages
1
Reaction score
0
I have a long running aspx user control that has javascript function to display a message when the timeout has occured. I have a AnimationTarget to disable the "Submit" button (which causes the timeout if the database is busy) but when the timeout occurs, the page has to be refreshed for the button to be enabled again. Is there a way I can re-enable the button (via the javascript maybe?) without refreshing the page?

Thanks


Code:
<cc1:UpdatePanelAnimationExtender ID="ae" runat="server" TargetControlID="UpdatePanel1">
    <Animations>
                    <OnUpdating>
                        <Parallel duration="0">
                           <%-- <FadeOut minimumOpacity=".5" />--%>
                            <EnableAction AnimationTarget="btnSubmit" Enabled="false" />
                         </Parallel>
                    </OnUpdating>
                    <OnUpdated>
                        <Parallel duration="0">
                            <EnableAction AnimationTarget="btnSubmit" Enabled="true" />
                            <%--<FadeIn minimumOpacity=".5" />--%>
                        </Parallel> 
                    </OnUpdated>
    </Animations>
</cc1:UpdatePanelAnimationExtender>




Code:
<script type="text/javascript">
    Sys.WebForms.PageRequestManager.getInstance().add_endRequest(function(sender, args) {
        if (args.get_error() && args.get_error().name === 'Sys.WebForms.PageRequestManagerTimeoutException') {
            alert('A timeout occured. This can happen when the database is busy. Please try again in a few moments.');
            // remember to set errorHandled = true to keep from getting a popup from the AJAX library itself 
            args.set_errorHandled(true);
        }
    }); 
</script>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top