Click here to Skip to main content
15,947,411 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have an asp.net website in C#.

Where in some pages i'm using update panel with update panel progress.

In the updatePanelProgress i have add a loader image which is not getting hide after the button click and this button in the updatepanel.(to download pdf report)

<asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <table>
                    <tr>
                        <td class="DateFromTXT_PJ vmiddle hcenter" style="width: auto; padding: 0 8px; line-height: 20px;">
                            Select
                        </td>
                        <td class="vmiddle" style="width: auto; padding: 0 8px; line-height: 20px;">
                            <asp:DropDownList ID="ddldept" CssClass="selectbox_department" runat="server">
                            </asp:DropDownList>
                        </td>
                        <td class="DateFromTXT_PJ vmiddle hcenter" style="width: auto; padding: 0 8px; line-height: 20px;">
                            From
                        </td>
                        <td class="vmiddle" style="width: auto; padding: 0 8px; line-height: 20px;">
                            <asp:TextBox ID="txtDatefrom" CssClass="txtbox_namenormal" runat="server" Width="68px"></asp:TextBox>
                            <ajaxToolkit:CalendarExtender ID="calendarButtonExtender" CssClass="cal_Theme1"  runat="server"
                                TargetControlID="txtDatefrom" PopupButtonID="txtDatefrom" />
                        </td>
                        <td class="DateFromTXT_PJ vmiddle hcenter" style="width: auto; padding: 0 8px; line-height: 20px;">
                            To
                        </td>
                        <td class="vmiddle" style="width: auto; padding: 0 8px; line-height: 20px;">
                            <asp:TextBox ID="txtDateto" CssClass="txtbox_namenormal" runat="server" Width="68px"></asp:TextBox>
                            <ajaxToolkit:CalendarExtender ID="CalendarExtender1" CssClass="cal_Theme1"  runat="server"
                                TargetControlID="txtDateto" PopupButtonID="txtDateto" />
                        </td>
                        <td>
                            <asp:RadioButtonList ID="rbnEq" runat="server" RepeatColumns="2">
                                <asp:ListItem Selected="True" Text="Without Equipment" Value="0"></asp:ListItem>
                                <asp:ListItem Text="With Equipment" Value="1"></asp:ListItem>
                            </asp:RadioButtonList>
                        </td>
                        <td>
                            <asp:Button ID="btnSearch" runat="server" CssClass="WhiteBlackBtn" Text="Generate"
                                OnClick="btnSearch_Click" />  
                            <asp:Button ID="btnPDF" runat="server" CssClass="WhiteBlackBtn" Text="Download PDF"
                                Width="140px" OnClick="btnPDF_Click" />  
                            <input type="button" /> 
                            <%--<input type="button" id="btnExport" value="Export Table data into Excel" />--%>
                        </td>
                    </tr>
                </table>
                <br />
                <asp:Panel ID="PanelSearch" runat="server" Visible="false">
                    <table class="addgrid">
                        <tr>
                            <td>
                                Search
                            </td>
                            <td>
                                <asp:TextBox ID="txtsearch" runat="server" CssClass="txtbox_namenormal"></asp:TextBox> 
                                 
                                <asp:Button ID="btnget" runat="server" Text="Search" CssClass="rowbtn" OnClick="btnget_Click" />
                            </td>
                        </tr>
                    </table>
                </asp:Panel>
                <br />
                <div id="MyData">
                    <asp:Repeater ID="Repeater2" runat="server">
                        <HeaderTemplate>
                            <table id="DetailedTable" class="addgrid" width="100%">
                        </HeaderTemplate>
                        <ItemTemplate>
                            <tr style="background-image: removed('images/Background.png'); height: 30px; color: Black;
                                vertical-align: middle;">
                                <td>
                                    <asp:Label ID="lblDept" runat="server" Font-Bold="true" Text='<%# Eval("Department_Name") %>'></asp:Label>
                                    <asp:Label ID="lbldeptid" runat="server" Text='<%# Eval("DepartmentID") %>' Visible="false"></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Repeater ID="Repeater1" runat="server">
                                        <HeaderTemplate>
                                            <table class="addgrid" width="100%">
                                                <thead>
                                                    <tr style="background-image: removed('images/Background.png'); height: 30px; color: Black;
                                                        vertical-align: middle;">
                                                        <th style="width: 60px;" class="vmiddle hcenter">
                                                            Ticket
                                                        </th>
                                                        <th style="width: 70px;" class="vmiddle hcenter">
                                                            DRSS
                                                        </th>
                                                        <th style="width: 70px;" class="vmiddle hcenter">
                                                            Rig
                                                        </th>
                                                        <th style="width: 70px;" class="vmiddle hcenter">
                                                            Well
                                                        </th>
                                                        <th style="width: 110px;" class="vmiddle hcenter">
                                                            Job Type
                                                        </th>
                                                        <th>
                                                            Equipments
                                                        </th>
                                                        <th style="width: 70px;" class="vmiddle hcenter">
                                                            Mobilization Date
                                                        </th>
                                                        <th style="width: 50px;" class="vmiddle hcenter">
                                                            From Date
                                                        </th>
                                                        <th style="width: 60px;" class="vmiddle hcenter">
                                                            To Date
                                                        </th>
                                                        <th style="width: 50px;" class="vmiddle hcenter">
                                                            Job Est.Cost
                                                        </th>
                                                    </tr>
                                                </thead>
                                                <tbody>
                                        </HeaderTemplate>
                                        <ItemTemplate>
                                            <tr>
                                                <td class="vmiddle">
                                                    
                                                        <%# Eval("Tickte")%>
                                                </td>
                                                <td class="vmiddle">
                                                    <%# Eval("drss")%>
                                                </td>
                                                <td class="vmiddle">
                                                    <%# Eval("rig")%>
                                                </td>
                                                <td class="vmiddle">
                                                    <%# Eval("well")%>
                                                </td>
                                                <td class="vmiddle">
                                                    <%# Eval("jobtype")%>
                                                </td>
                                                <td>
                                                    <%# Eval("Equipments") %>
                                                </td>
                                                <td class="vmiddle">
                                                    <%# Eval("Mobilization_Date")%>
                                                </td>
                                                <td class="vmiddle">
                                                    <%# Eval("fromdate")%>
                                                </td>
                                                <td class="vmiddle">
                                                    <%# Eval("todate")%>
                                                </td>
                                                <td align="right" class="vmiddle" style="text-align: right;">
                                                    <asp:Label ID="lbljobcost" runat="server" Text='<%# Eval("JobCost")%>'></asp:Label>
                                                </td>
                                            </tr>
                                        </ItemTemplate>
                                        <FooterTemplate>
                                            <tr>
                                                <td colspan="8">
                                                </td>
                                                <td>
                                                    <center>
                                                        Total 
                                                    </center>
                                                </td>
                                                <td align="right" class="vmiddle" style="text-align: right;">
                                                    
                                                        <asp:Label ID="lbltotal" runat="server"></asp:Label>
                                                </td>
                                            </tr>
                                            </tbody> </table>
                                        </FooterTemplate>
                                    </asp:Repeater>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Repeater ID="Repeater3" runat="server">
                                        <HeaderTemplate>
                                            <table class="addgrid" width="100%">
                                                <thead>
                                                    <tr style="background-image: removed('images/Background.png'); height: 30px; color: Black;
                                                        vertical-align: middle;">
                                                        <th style="width: 60px;" class="vmiddle hcenter">
                                                            Ticket
                                                        </th>
                                                        <th style="width: 70px;" class="vmiddle hcenter">
                                                            DRSS
                                                        </th>
                                                        <th style="width: 70px;" class="vmiddle hcenter">
                                                            Rig
                                                        </th>
                                                        <th style="width: 70px;" class="vmiddle hcenter">
                                                            Well
                                                        </th>
                                                        <th style="width: 110px;" class="vmiddle hcenter">
                                                            Job Type
                                                        </th>
                                                        <th style="width: 70px;" class="vmiddle hcenter">
                                                            Mobilization Date
                                                        </th>
                                                        <th style="width: 50px;" class="vmiddle hcenter">
                                                            From Date
                                                        </th>
                                                        <th style="width: 60px;" class="vmiddle hcenter">
                                                            To Date
                                                        </th>
                                                        <th style="width: 50px;" class="vmiddle hcenter">
                                                            Job Est.Cost
                                                        </th>
                                                    </tr>
                                                </thead>
                                                <tbody>
                                        </HeaderTemplate>
                                        <ItemTemplate>
                                            <tr>
                                                <td class="vmiddle">
                                                    
                                                        <%# Eval("Tickte")%>
                                                </td>
                                                <td class="vmiddle">
                                                    <%# Eval("drss")%>
                                                </td>
                                                <td class="vmiddle">
                                                    <%# Eval("rig")%>
                                                </td>
                                                <td class="vmiddle">
                                                    <%# Eval("well")%>
                                                </td>
                                                <td class="vmiddle">
                                                    <%# Eval("jobtype")%>
                                                </td>
                                                <td class="vmiddle">
                                                    <%# Eval("Mobilization_Date")%>
                                                </td>
                                                <td class="vmiddle">
                                                    <%# Eval("fromdate")%>
                                                </td>
                                                <td class="vmiddle">
                                                    <%# Eval("todate")%>
                                                </td>
                                                <td align="right" class="vmiddle" style="text-align: right;">
                                                    <asp:Label ID="lbljobcost" runat="server" Text='<%# Eval("JobCost")%>'></asp:Label>
                                                </td>
                                            </tr>
                                        </ItemTemplate>
                                        <FooterTemplate>
                                            <tr>
                                                <td colspan="7">
                                                </td>
                                                <td>
                                                    <center>
                                                        Total 
                                                    </center>
                                                </td>
                                                <td align="right" class="vmiddle" style="text-align: right;">
                                                    
                                                        <asp:Label ID="lbltotal" runat="server"></asp:Label>
                                                </td>
                                            </tr>
                                            </tbody> </table>
                                        </FooterTemplate>
                                    </asp:Repeater>
                                </td>
                            </tr>
                        </ItemTemplate>
                        <FooterTemplate>
                            <tr>
                                <td>
                                    <table width="100%">
                                        <tr>
                                            <td style="width: 80%">
                                            </td>
                                            <td>
                                                Grand Total: 
                                                <asp:Label Font-Bold="true" ID="lblgrandtotal" runat="server"></asp:Label>
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                            </table>
                        </FooterTemplate>
                    </asp:Repeater>
                    <div  runat="server" id="mySpace"></div>
                    <br />
                    <br />
                    <br />
                    <br />
                    <br />
                    <br />
                    <br />
                    <br />
                    <br />
                    <br />
                    <br />
                    <br />
                    <br />
                    <br />
                    <br />
                </div>
            </ContentTemplate>
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="btnSearch" />
                <asp:AsyncPostBackTrigger ControlID="btnget" />
                <asp:AsyncPostBackTrigger ControlID="btnPDF" />
            </Triggers>
        </asp:UpdatePanel>
        <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1" DynamicLayout="false">
            <ProgressTemplate>
                <div id="dvProgress"  runat="server" style="position: absolute; top: 150px; left: 700px;
                    text-align: center;">
                    <asp:Image ID="Image2" runat="server" Height="46px" Width="47px" ImageUrl="~/images/ajax-loader.gif" />
                </div>
            </ProgressTemplate>
        </asp:UpdateProgress>


can any one please help me, how can i hide the loader image after downloading the pdf.


thanks
Posted
Updated 5-Dec-15 19:18pm
v2

1 solution

I can't see your updatePanelProgress in here, but if you are adding an element there you can hide it on that button clicked event easily.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900