AJAX Animation and timeouts

Discussion in '.NET' started by Teldin, May 5, 2010.

  1. Teldin

    Teldin

    Joined:
    May 5, 2010
    Messages:
    1
    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>
    Teldin, May 5, 2010
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?SmFzb24=?=

    forms authentication timeouts and session timeouts

    =?Utf-8?B?SmFzb24=?=, Jun 22, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    449
    =?Utf-8?B?SmFzb24=?=
    Jun 22, 2004
  2. webdevaccount@gmail.com

    ASP.NET AJAX Timer + UpdatePanel + Server Request Timeouts

    webdevaccount@gmail.com, Jun 21, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    2,247
    urmilshah@gmail.com
    Jul 2, 2007
  3. =?Utf-8?B?TWlrZQ==?=
    Replies:
    2
    Views:
    981
    =?Utf-8?B?TWlrZQ==?=
    Oct 30, 2007
  4. Lloyd Sheen
    Replies:
    1
    Views:
    393
    Lloyd Sheen
    Nov 30, 2007
  5. Chaprasi

    Ajax Timeouts

    Chaprasi, May 23, 2006, in forum: Javascript
    Replies:
    15
    Views:
    223
    Chaprasi
    May 26, 2006
Loading...

Share This Page