Click here to Skip to main content
14,362,998 members
Rate this:
Please Sign up or sign in to vote.
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!
Rate this:
Please Sign up or sign in to vote.

Solution 1

Try this way
1)
<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 !!
   
Rate this:
Please Sign up or sign in to vote.

Solution 2

Here is an article for handling similar situations: Customizable 'Loading' Control for Web Applications with Designer Support[^]
   
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.
Rate this:
Please Sign up or sign in to vote.

Solution 3

Using Ajax UpdateProgress you can do it. What web works says is correct.
   
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, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100