Implement a Please Wait Page

  • Thread starter Thread starter Stephajn Craig
  • Start date Start date
S

Stephajn Craig

I have one page that may take a while to process on the server, and I'd like
to implement a please wait message on this page when it posts back to the
server and does its business.

The page is an ASP.NET webform that contains a Web User Control. The Web
User Control is doing all of the work posting. How can I inform the user of
what is happening at the server while the data from this web user control is
being processed?
 
It sounds like you should consider using multithreading.
By running the long process on a separate thread, you free the browser up to
do other things, such as display the current status of the task.
That way the browser will respond immediately with a new page and can
entertain the user while they wait with an animation or status bar.
You can have the browser refresh the status by putting an HTML line like
this in your code:
<META HTTP-EQUIV="refresh" CONTENT="3">
That will cause the browser to refresh every 3 seconds (and you can check
the status of the operation each time and redirect to a "done" page when
appropriate.)
Here's more details:
http://www.fawcette.com/vsm/2002_11/magazine/features/chester/
http://www.dotnetjunkies.com/tutorials.aspx?tutorialid=547

Another option is that you could call a web service from your client side
JScript. Use the web service behavior for this. (WebService.htc) This
technique works with IE only.
Here's more details:
http://msdn.microsoft.com/library/default.asp?url=/workshop/author/behaviors/overview.asp

http://msdn.microsoft.com/downloads...rnet/behaviors/library/webservice/default.asp
 
Thanks Steve! Both of these methods helped. The only question is to decide
which one to use. I like the Web Service method becasue it doesn't need a
full refresh of the page. However, I also like the MultiThreaded Approach
because it allows me to hold some items within the current HttpContext at
Serverside. (Like a Collection)

The scenario is that all of this data is going to be loaded into a database,
but then also some checks will be done against it at serverside to ensure
that no conflicts will occur. (Like one Person scheduled for a meeting
isn't already scheduled for another)

Once the data is done posting, the server would be holding a collection of
issues that will need to be resolved or ignored if the user wishes it.

Any ideas on which method you would use ?



--
Stephajn Craig
Steve C. Orr said:
It sounds like you should consider using multithreading.
By running the long process on a separate thread, you free the browser up to
do other things, such as display the current status of the task.
That way the browser will respond immediately with a new page and can
entertain the user while they wait with an animation or status bar.
You can have the browser refresh the status by putting an HTML line like
this in your code:
<META HTTP-EQUIV="refresh" CONTENT="3">
That will cause the browser to refresh every 3 seconds (and you can check
the status of the operation each time and redirect to a "done" page when
appropriate.)
Here's more details:
http://www.fawcette.com/vsm/2002_11/magazine/features/chester/
http://www.dotnetjunkies.com/tutorials.aspx?tutorialid=547

Another option is that you could call a web service from your client side
JScript. Use the web service behavior for this. (WebService.htc) This
technique works with IE only.
Here's more details:
http://msdn.microsoft.com/library/d...rnet/behaviors/library/webservice/default.asp

--
I hope this helps,
Steve C. Orr, MCSD
http://Steve.Orr.net


Stephajn Craig said:
I have one page that may take a while to process on the server, and I'd like
to implement a please wait message on this page when it posts back to the
server and does its business.

The page is an ASP.NET webform that contains a Web User Control. The Web
User Control is doing all of the work posting. How can I inform the
user
of
what is happening at the server while the data from this web user
control
 
Well the web services strategy probably wouldn't work as well in a
cross-browser environment.
So if you have cross-browser requirements then that makes your decision
easy.

Expedia employs a multithreaded approach similar to what I described and it
looks pretty sharp. Look up a flight and see what I mean.

--
I hope this helps,
Steve C. Orr, MCSD
http://Steve.Orr.net


Stephajn Craig said:
Thanks Steve! Both of these methods helped. The only question is to decide
which one to use. I like the Web Service method becasue it doesn't need a
full refresh of the page. However, I also like the MultiThreaded Approach
because it allows me to hold some items within the current HttpContext at
Serverside. (Like a Collection)

The scenario is that all of this data is going to be loaded into a database,
but then also some checks will be done against it at serverside to ensure
that no conflicts will occur. (Like one Person scheduled for a meeting
isn't already scheduled for another)

Once the data is done posting, the server would be holding a collection of
issues that will need to be resolved or ignored if the user wishes it.

Any ideas on which method you would use ?



--
Stephajn Craig
Steve C. Orr said:
It sounds like you should consider using multithreading.
By running the long process on a separate thread, you free the browser
up
to
do other things, such as display the current status of the task.
That way the browser will respond immediately with a new page and can
entertain the user while they wait with an animation or status bar.
You can have the browser refresh the status by putting an HTML line like
this in your code:
<META HTTP-EQUIV="refresh" CONTENT="3">
That will cause the browser to refresh every 3 seconds (and you can check
the status of the operation each time and redirect to a "done" page when
appropriate.)
Here's more details:
http://www.fawcette.com/vsm/2002_11/magazine/features/chester/
http://www.dotnetjunkies.com/tutorials.aspx?tutorialid=547

Another option is that you could call a web service from your client side
JScript. Use the web service behavior for this. (WebService.htc) This
technique works with IE only.
Here's more details:
http://msdn.microsoft.com/library/d...rnet/behaviors/library/webservice/default.asp
 
If you just want to display a simple message like "Please wait
loading...it may take few minutes..", you can do that using layers.

Create a DIV tag for the complete page size and have an animated image
in it to show that the page is loading. On the page load hide this
layer and on unload of the page bring it to the top(z-index) and show
it. If you use smart navigation, this page will be shown until your
long reaquest gets completed and displayed in the browser.

I did this in one of my projects and my queries may run longer than
six minutes. It is working fine and is in production.

Thanks
Ram
 
Back
Top