Click here to Skip to main content
16,017,502 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hi All,

I wanted to show loading image while page loading. because of page load is taking time since page having third party controls.
Posted

if you are using the ajax , you can also use update progress control.

http://ajax.net-tutorials.com/controls/updateprogress-control/
 
Share this answer
 
Hello Kushwant,

I'm using modalpopupextender in previous page and a button btnContinue to redirect the url. I have written a code like this:
in Javascript:
<pre lang="Javascript">
function pageLoad() {
$find('ctl00_GFSTMSContentPlaceHolder1_ModalProgress').hide();
}
Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(
function(sender, e) {
if (e.get_postBackElement().id == "ctl00_GFSTMSContentPlaceHolder1_btnContinue") // This line can make sure only the request from GridView1 will present popup panel, you can change it to other control client id.
{
$find('ctl00_GFSTMSContentPlaceHolder1_ModalProgress').show();
}
});
</pre>
and in Asp:content (using asp:content because its a child page)
<pre lang="HTML">
<asp:Panel ID="panelUpdateProgress" runat="server">
<asp:UpdateProgress ID="UpdateProg1" DisplayAfter="10" runat="server">
<ProgressTemplate>
<img src="../../Images/progress.gif" style="vertical-align: middle" alt="Processing" />
</ProgressTemplate>
</asp:UpdateProgress>
</asp:Panel>
<asp:ModalPopupExtender ID="ModalProgress" runat="server" TargetControlID="panelUpdateProgress"
BackgroundCssClass="modalBackground" PopupControlID="panelUpdateProgress">
</asp:ModalPopupExtender>
</pre>
This will work for me in previous page but the problem is, when it redirect to another page lets say "Index.aspx", while loading this index page loading image will get stuck till page is loaded.
 
Share this answer
 
The best way is to use an another html let say index.html with refresh tag that points to your long loading page. This way the loading of the load page are hidden in index.html.

XML
<html>
<head>
    <meta http-equiv="refresh" content="2;url=/PutYourLongLoadingPageHe.aspx">
    <title>Sample Title</title>
</head>
<body>
    <div>
        <img scr="wait.gif"</> Please wait while loading the page
    </div>
</body>
</html>
 
Share this answer
 
v2
If I am getting you correctly then you can use the display after property of update progress. By default, the UpdateProgress control is displayed a half-second after the partial-page
update starts. You can set the DisplayAfter property to the number of milliseconds to wait before displaying the UpdateProgress content.
 
Share this answer
 

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