468,537 Members | 1,912 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,537 developers. It's quick & easy.

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

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.

Nov 19 '05 #1
5 3181
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.

Nov 19 '05 #2
Man, I messed up that first sentence...oh well...

"Brad Roberts" wrote:
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.

Nov 19 '05 #3
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.
"Brad Roberts" wrote:
Man, I messed up that first sentence...oh well...

"Brad Roberts" wrote:
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.

Nov 19 '05 #4
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!
"falcon" wrote:
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.
"Brad Roberts" wrote:
Man, I messed up that first sentence...oh well...

"Brad Roberts" wrote:
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.

Nov 19 '05 #5
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.

"PontiMax" wrote:
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!
"falcon" wrote:
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.
"Brad Roberts" wrote:
Man, I messed up that first sentence...oh well...

"Brad Roberts" wrote:

> 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.
>

Nov 19 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by Tim Clacy | last post: by
5 posts views Thread by Mark Shelor | last post: by
29 posts views Thread by Richard A. Huebner | last post: by
4 posts views Thread by Lingyun Yang | last post: by
12 posts views Thread by wenmang | last post: by
21 posts views Thread by Charles Sullivan | last post: by
12 posts views Thread by Ahmad Jalil Qarshi | last post: by
2 posts views Thread by PengYu.UT | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.