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

I am developing a web application in which i have to redirect from default page to other pages which will fetch data from database it is time taking so i wanna display a image while page is loading.

I have tried UpdatePanelProgress and few javascript functions also but it is not displaying while the page loads. here i am using master page and child pages for child pages i need to display the image.



Thanks,
K.Vigneshwar.
Posted
Comments
pankajupadhyay29 25-Apr-11 12:46pm    
me too!

Try this way
1)
XML
<div id="divWait" style="display: none;">
    <img src='<%=ResolveUrl("~/images/plsWaitImg.gif")%>' alt="Please wait while loading data" style="vertical-align: middle;" />
    &nbsp; loading...<br />
    <br />
    Please wait...
</div>

Then write Javascript to hide this div

2) Using Ajax
<asp:UpdateProgress AssociatedUpdatePanelID="updatePnlID" ID="prgId1" runat="server">
    <ProgressTemplate>
        <img src='<%=ResolveUrl("~/images/plsWaitImg.gif")%>' alt="Please wait while loading data" />
        &nbsp; Please wait...
    </ProgressTemplate>
</asp:UpdateProgress>
//and here would be your update panel
<asp:UpdatePanel ID="upnlStats" runat="server" UpdateMode="Conditional">
    ............
</asp:UpdatePanel>

Good Luck !!
 
Share this answer
 
Here is an article for handling similar situations: Customizable 'Loading' Control for Web Applications with Designer Support[^]
 
Share this answer
 
Comments
Vigneshb6 26-Apr-11 4:17am    
But in IE it is not working i am getting error as Response is not available in this page.
Using Ajax UpdateProgress you can do it. What web works says is correct.
 
Share this answer
 
Comments
Vigneshb6 26-Apr-11 4:19am    
But when i am keeping in master page it is not working and keeping in child pages it is showing only for the click events not for the page load

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



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