I have a legacy classic ASP page that is taking a long time to load. This is because before loading it must run a large number of database queries. Load time is upwards of 10 seconds.
The page structure looks like this:
<% SQL Queries %>
<html>...Display the data from the queries..</html>
ie, all the queries occur before the markup renders.
Due to the long load times I want to create a loading screen that will run before the queries start and close when the queries end, to provide an indication to the user. I'm wondering how to do this? The examples I've seen (such as BlockUI) rely on the page being called through ajax, but this particular page is being called using a standard 'a href'.
Thanks.
I was facing the same problem and this worked for me:
default.asp (when it runs for the first time it doesn't return any records because the query has no parameter):
functions.js:
the simplest way of doing this is showing the info (with javascript) when the onclick event of the tag is raised. when the page with the long lasting sqls is completely loaded this info is removed automatically because the new page is loaded and shown.
this only works when Response.buffer is true but that is the standard setting....
example:
Classic ASP comes with the handy Response.Flush command. Such code will cause content to appear before the SQL queries start executing:
Now to hide it after queries are done you need simple jQuery: