UpdateProgress not working for button which is in inside of trigger property

Singaravelan picture Singaravelan · Feb 27, 2014 · Viewed 13.5k times · Source
     <asp:UpdatePanel ID="Upnl1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
      <table width="100%"><tr>
                            <td align="center" colspan="3">
                                <asp:Button ID="btnShowReport" runat="server" CssClass="ButtonClassLong" SkinID="LargeButton"
                                    Text="Show Report" OnClick="btnShowReport_Click"   TabIndex="15" />
                                <asp:Button ID="btnClear" runat="server" CssClass="ButtonClass" Text="Clear" OnClick="btn_Click"
                                    TabIndex="16" />
                                <asp:Button ID="btnClose" runat="server" CssClass="ButtonClass" OnClick="btnClose_Click"
                                    Text="Close" CausesValidation="False" TabIndex="17" />
                                <asp:CheckBox ID="ChkPrint" Text="Print View" runat="server" TabIndex="14" />
                            </td>
                        </tr>
                    </table></ContentTemplate>
<Triggers>
     <asp:PostBackTrigger ControlID="btnShowReport" />
</Triggers></asp:UpdatePanel><asp:UpdateProgress ID="UpdateProgress" runat="server">
            <ProgressTemplate>
                <asp:Image ID="Image1" ImageUrl="~/App_Themes/RIBO/Images/Progress.gif" AlternateText="Processing"
                    runat="server" />
            </ProgressTemplate>
        </asp:UpdateProgress>

This is my coding , My issue is when i click the clear button the update progress working well, when i click btnShowReport it wont work.

how to show the update progress for button click event which is in inside the trigger property.

Answer

Mayank Pathak picture Mayank Pathak · Feb 27, 2014

Problem is AssociatedUpdatePanelID . You havn't set Associateid of your 'UpdateProgress`

set it on UpdateProgress

<asp:UpdateProgress ID="UpdateProgress" runat="server"  AssociatedUpdatePanelID="Upnl1">

As per MSDN

The UpdateProgress control renders a element that is displayed or hidden depending on whether an associated UpdatePanel control has caused an asynchronous postback. For initial page rendering and for synchronous postbacks, the UpdateProgress control is not displayed.

EDIT:

Reason is <asp:PostBackTrigger ControlID="btnShowReport" />

Which will cause a full page postback. You should change your Trigger to

<asp:AsyncPostBackTrigger ControlID="btnShowReport" />

and it will do the job for you...If you could have read the quoted statement you would have able to solve it by yourself too...