Wait while loading.....

  • Thread starter Thread starter Jonas Nilsson
  • Start date Start date
J

Jonas Nilsson

How can i show a "Wait while loading..." text on my aspx page while loading
data into a datagrid from a database.

/Jonas
 
You pretty much can't as you cannot control what the browser shows to the
user while it's loading a page. There are some things you can do (use a
redirect page or send part of the response first by flushing the response
object) but none are 100% guaranteed to work.

Jerry
 
I just had the same requirement and it works great:

sub Page_Load()
Response.Write("<br><div align='center' id=myMessage style='font-family
Tahoma; font-size: 18; color:Red'>Loading report, please wait...</div>")
Response.flush
End Sub

sub DisplayReport()

'-- code that reads database here.....

End Sub

<html>
<head>
</head>
<body onload="clearWaitMessage();" >
<center>
<p>

<%Call DisplayReport%>
</p>

</center>
</body>
</html>

<SCRIPT LANGUAGE=JavaScript>
<!--function clearWaitMessage() {
myMessage.innerHTML = "";
}
//-->
</SCRIPT>
 
Back
Top