Manage Page Load Time

June 8, 2009

It is widely accepted that fast loading pages improve the user experience. Today’s article is all about the Page Load Time how can we manage and display user some message or loading picture while server is working on the request.

In the example I will show you how can you use the page load method using Javascripts and you can use it for pages having huge data.

Save this file as PageLoad.aspx

HTML
HEAD
title PageLoad /title
script language=”javascript”
function BeginPageLoad() {
frame1.document.location = “PleaseWait.htm”;
location.href = “”;
}
/script
/HEAD
body onload=”BeginPageLoad()”
form id=”Form1″ method=”post” runat=”server”
table border=”0″ cellpadding=”0″ cellspacing=”0″ width=”99%” height=”99%” align=”center” valign=”middle” ID=”Table1″
tr
td align=”center” valign=”middle”
font color=”navy” size=”7″ >< iframe id="frame1" frameborder="no" width="400" height="180" /
/font
/td
/tr
/table
/form
/body
/HTML

Create another file PleaseWait.htm
Add any Text message like "Please wait while opening the page." or you can use the animated loading picture.

How to call the Page Load – Page load with wait in the client side and wait until the target table fully loaded.
Simply you can use this in the Menu or you can also call it hyper link. see the below example.
A href="PageLoad.aspx?page=default.aspx" Home /A
A href="PageLoad.aspx?page=Products.aspx"Products/A

Example source: TechEd

Leave a Reply