AJAX Animation and timeouts

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

  1. Teldin

    Teldin

    Joined:
    May 5, 2010
    Messages:
    1
    Likes Received:
    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 (Text):
    <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 (Text):
    <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. Advertisements

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:
    641
    =?Utf-8?B?SmFzb24=?=
    Jun 22, 2004
  2. minnie
    Replies:
    1
    Views:
    1,058
    Andrew Thompson
    Dec 13, 2006
  3. 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,494
    urmilshah@gmail.com
    Jul 2, 2007
  4. =?Utf-8?B?TWlrZQ==?=
    Replies:
    2
    Views:
    1,210
    =?Utf-8?B?TWlrZQ==?=
    Oct 30, 2007
  5. Bjorn Sagbakken

    Ajax animation: Interpolated, question

    Bjorn Sagbakken, Nov 18, 2007, in forum: ASP .Net
    Replies:
    0
    Views:
    567
    Bjorn Sagbakken
    Nov 18, 2007
  6. Lloyd Sheen
    Replies:
    1
    Views:
    465
    Lloyd Sheen
    Nov 30, 2007
  7. vcuankitdotnet

    AJAX Animation Extender

    vcuankitdotnet, Mar 18, 2008, in forum: ASP .Net
    Replies:
    1
    Views:
    12,456
    girish2250
    Sep 7, 2009
  8. Chaprasi

    Ajax Timeouts

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