Link to home
Start Free TrialLog in
Avatar of b9frosty
b9frosty

asked on

page refresh or display waiting in asp

Hi,  Im using an asp page that runs a bunch of things on the server.  It is initiated by the user clicking a button on the page.  Because this takes a while, I want to display a simple message on the page to say that is is currently working.  Now, whatever I write doesn't appear on the screen until the process is complete.  Any Ideas?
Avatar of mattyk
mattyk

The most foolproof way to handle this is to have your hyperlink go to an intermediate html page which would look something like this

<script>
window.location="yourASPpage.asp"
</script>
<body>
Please Wait Loading Page...
</body>


of course the page can say look like anything you'd like.

-matty
Avatar of b9frosty

ASKER

Is it possible to keep the same page visible that I have and just add a line that says "Please Wait"?  I'm not sure I can do it since the page has already been sent to the browser unless I can append it throught the asp.  If not, I'll do it the way you described.  Thanks.
If you don't mind using the status bar, you can do something like this:

At the top of your ASP code (right under the language designation), add:

<%response.buffer=true%>
<script>
<%response.write "status='Loading this Page'"%>
</script>
<%Response.Flush%>

Then, in the <BODY> tag, add, "onload='status="Done;"'" (without the outside "s).

You can also use this script to open a popup window which closes when the page is finished loading.

You could probably do something similar using a <div> which you could flush down to the browser and then remove from the display when the page was loaded.  Michel Plungjan (mplungjan) has posted JavaScript code for such an item.  If this seems promising I can look around for the code.  It functions like a popup window.

Tom
You could turn buffering off for your page, and avoid putting results in tables (most browsers have to receive the whole table before it can work out how to render it).
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
[PAQ with NO REFUND]

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

hongjun
EE Cleanup Volunteer
ASKER CERTIFIED SOLUTION
Avatar of SpideyMod
SpideyMod

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial