Reputation: 1342
I have used Ajax in my website. In the Site.Master file I have the following code:
<div>
<asp:UpdateProgress ID="UpdateProgress" runat="server">
<ProgressTemplate>
<asp:Image ID="Image1" ImageUrl="~/Images/295.gif" AlternateText="Processing" runat="server" />
</ProgressTemplate>
</asp:UpdateProgress>
<ajaxToolkit:ModalPopupExtender ID="modalPopup" runat="server" TargetControlID="UpdateProgress"
PopupControlID="UpdateProgress" BackgroundCssClass="modalPopup" />
</div>
This results in a PRELOADER on each child page where I have implemented UpdatePanel. This is ok till now.
But I have one page, that has a grid which refreshes every second. It also uses updatePanel to fetch data from the server. This page inherits from site.master as well, therefore, every second I see the preloader sign in it. This looks so bad on the design.
I want to be able to just disable preloader on only this page. Is there a way of doing it ?
Here is the code of my Child Form:
<asp:Panel ID="panel1" runat="server">
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GridView1" runat="server" DataSourceID="SqlDataSource1" AutoGenerateColumns="False"
CellPadding="4" ForeColor="#333333" GridLines="None">
<AlternatingRowStyle BackColor="White" ForeColor="#284775" />
<Columns>
<asp:BoundField DataField="WBWeight" HeaderText="WBWeight" SortExpression="WBWeight">
</asp:BoundField>
<asp:BoundField DataField="bowzer_no" HeaderText="bowzer_no" SortExpression="bowzer_no" />
<asp:BoundField DataField="FLD" HeaderText="FLD" SortExpression="FLD" />
<asp:BoundField DataField="Product_Name" HeaderText="Product_Name" SortExpression="Product_Name" />
<asp:BoundField DataField="Customer_Name" HeaderText="Customer_Name" SortExpression="Customer_Name" />
<asp:BoundField DataField="quantity" HeaderText="quantity" SortExpression="quantity" />
</Columns>
<EditRowStyle BackColor="#999999" />
<FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
<RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
<SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
<SortedAscendingCellStyle BackColor="#E9E7E2" />
<SortedAscendingHeaderStyle BackColor="#506C8C" />
<SortedDescendingCellStyle BackColor="#FFFDF8" />
<SortedDescendingHeaderStyle BackColor="#6F8DAE" />
</asp:GridView>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" />
</Triggers>
</asp:UpdatePanel>
<ajaxToolkit:UpdatePanelAnimationExtender ID="UpdatePanel1_UpdatePanelAnimationExtender"
runat="server" Enabled="True" TargetControlID="UpdatePanel1">
</ajaxToolkit:UpdatePanelAnimationExtender>
</asp:Panel>
Upvotes: 0
Views: 422
Reputation: 17724
The simplest method to work around this would be to hide your loader on this page.
Give a css class to your image in your master page, and use that class to hide it on the page.
MasterPage:
<asp:UpdateProgress ID="UpdateProgress" runat="server">
<ProgressTemplate>
<asp:Image ID="Image1" CssClass="loader" ImageUrl="~/Images/295.gif" AlternateText="Processing" runat="server" />
</ProgressTemplate>
</asp:UpdateProgress>
Page:
<style>
.loader{display: none}
</style>
Upvotes: 1