Long-running task: Show DIV with 'Please wait' message

G

Guest

Hi,

when I press the OK button of my dialog box a long-running task is
initiated. Therefore I would like to make visible a div section right after
clicking the button where a user-friendly message is displayed...

How can this be done? Can I make the section visible via server-side code?
Via Response.Write()?

Any examples would be appreciated!

Many thanks,
P.
 
G

Guest

I something like use the following to accomplish this.

- A button on a web page is clicked by the user to initiate a long running
process (in my case a report in another window)
- The click event calls a "PleaseWait" page that displays a message about
the amount of time that is expected to elapse and a visible bar-ticker that
is incremented each second. This page also has a ReFresh META tag in it that
calls the "long processing page" after 3 seconds.
- While the long-running page is running on the server the user is
entertained by the moving bar in the browser. If the process takes more than
70 seconds I change the message on the screen to something like "Thank you
for your patience..."
- When the long-running page is finished processing it writes content to the
browser, replacing the PleaseWait page.
 
G

Guest

Put your div with your message on the page and set its style.display = "none"
absolutely positioned where you want it.

When the user clicks the button, set the divs style.display = "block" and
call your long process.

when you get a return value from the process swap the divs display style back.

OR use a popup element or a modal dialog.

If your leaving the page anyway Brad's Method is better.
 
G

Guest

Thank you both for your help!

Falcon, your solution seems to fit better as I don't want to navigate to
another page but to close the message box right after the task has ended.

I began to implement your method but unfortunately the div section shows up
only after the dialog page was posted back. (I show the div by calling the
server-side code 'this.PleaseWaitDiv.Visible = false;')

Is there a way to display the div BEFORE the page is posted back? Do I have
to use client-side code for this?

Thanks!
 
G

Guest

Yes, Do it in javascript. Instead of launching your process directly have
your button (or whatever) have it call a client side function that shows the
div then launches the process.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top