Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > AJAX Animation and timeouts

Reply
Thread Tools

AJAX Animation and timeouts

 
 
Teldin Teldin is offline
Junior Member
Join Date: May 2010
Posts: 1
 
      05-05-2010
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>
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Timeouts (testing) for AJAX Web service calls Lloyd Sheen ASP .Net 1 11-30-2007 04:44 PM
ASP.NET AJAX Timer + UpdatePanel + Server Request Timeouts webdevaccount@gmail.com ASP .Net 2 07-02-2007 05:53 PM
AJAX IDE and AJAX TOOL--The Release of JoyiStar AJAX WebShop 3 Beta minnie Java 1 12-13-2006 06:29 AM
forms authentication timeouts and session timeouts =?Utf-8?B?SmFzb24=?= ASP .Net 0 06-22-2004 09:24 AM
Session-Timeouts and Idle-Timeouts on AS5300 and AS5800 Matt Cisco 1 02-17-2004 06:59 PM



Advertisments