Setting AssociatedUpdatePanelID to updateprogessbar is not working?

Last post 07-27-2009 10:49 PM by chetan.sarode. 2 replies.

Sort Posts:

  • Setting AssociatedUpdatePanelID to updateprogessbar is not working?

    07-27-2009, 8:57 AM
    • Member
      21 point Member
    • toakhtar
    • Member since 08-19-2008, 3:23 PM
    • Pakistan
    • Posts 34

     I have two updatepanel and a progressbar on the page. If I set the AssociatedUpdatePanelID, then progressbar is not working, without setting AssociatedUpdatePanelID progress bar is working but the problem is working on both updatepanel. But I need to work on one updatepanel.

     <asp:Button ID="Button1" runat="server" Text="Button1" OnClick="Button1_Click" />
            <asp:Button ID="Button2" runat="server" Text="Button2" OnClick="Button2_Click" />
            <asp:UpdateProgress runat="server" ID="prg" AssociatedUpdatePanelID="">
                <ProgressTemplate>
                    <img src="Images/progressbar.gif" />
                </ProgressTemplate>
            </asp:UpdateProgress>
            <br />
            <asp:UpdatePanel runat="server" ID="upnl" UpdateMode="Conditional">
                <ContentTemplate>
                </ContentTemplate>
                <Triggers>
                    <asp:AsyncPostBackTrigger ControlID="Button1" EventName="Click" />
                </Triggers>
            </asp:UpdatePanel>
            <asp:UpdatePanel runat="server" ID="upnl1" UpdateMode="Conditional">
                <ContentTemplate>
                </ContentTemplate>
                <Triggers>
                    <asp:AsyncPostBackTrigger ControlID="Button2" EventName="Click" />
                </Triggers>
            </asp:UpdatePanel>

    Code Behind - C#

    protected void Button1_Click(object sender, EventArgs e)
        {
            System.Threading.Thread.Sleep(3000);
        }
        protected void Button2_Click(object sender, EventArgs e)
        {
            System.Threading.Thread.Sleep(3000);
        }

    In this video, he also not set AssociatedUpdatePanelID http://www.asp.net/learn/ajax-videos/video-123.aspx

    Mark as Answer if this reply helps you

    Muhammad Akhtar
    Software Engineer
    Microsoft Certified Technology Specialist(ASP.Net 2.0)
    toakhtar@hotmail.com
    bcs620_akhtar@yahoo.com
  • Re: Setting AssociatedUpdatePanelID to updateprogessbar is not working?

    07-27-2009, 10:17 AM
    Answer
    • Contributor
      2,060 point Contributor
    • andreadottor
    • Member since 01-25-2007, 10:21 AM
    • Italy
    • Posts 312
    • TrustedFriends-MVPs

    If you read this
    http://www.codedigest.com/Articles/ASPNETAJAX/125_Using_UpdateProgress_Control_Effectively.aspx
    "it will not enable the UpdateProgress control for a postback caused by an external trigger of the UpdatePanel"

    And you can find a solution in this thread:
    http://stackoverflow.com/questions/996957/why-does-update-progress-does-not-fire-when-associatedupdatepanelid-is-set

    If this answers your question, please select 'mark as answer' thanks!



    Andrea Dottor
    Microsoft MVP - ASP/ASP.NET
  • Re: Setting AssociatedUpdatePanelID to updateprogessbar is not working?

    07-27-2009, 10:49 PM

     If the ChildrenAsTriggers property of a UpdatePanel control is set to false and an asynchronous postback originates from inside that UpdatePanel control, any associated UpdateProgress controls will be displayed.

    You can programmatically control when an UpdateProgress control is displayed by using the JavaScript beginRequest and endRequest events of the PageRequestManager class. In the beginRequest event handler, display the DOM element that represents the UpdateProgress control. In the endRequest event handler, hide the element.

    External triggers for an UpdatePanel do not fire an associated UpdateProgress, since the implementation of enabling the UpdateProgress control searches the control hierarchy for the calling control; an external trigger will not be present in the control hierarchy.

    Chetan Sarode
    Software Engineer,
    Approva Systems Pvt Ltd,
    Pune, India.
Page 1 of 1 (3 items)