Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Display "waiting" pages while long running operations complete

Reply
Thread Tools

Display "waiting" pages while long running operations complete

 
 
Jono
Guest
Posts: n/a
 
      10-05-2006
Hi Everyone,

As it says in the title, I'm looking for a way to display a page while
long running operations are performed on the server. Ideally, I'd like
some way to push the current request onto some stack, where it would
continue to be processed asynchronously (most importantly preserving
things like view state, form post data, etc). In the interim, while the
main request is processed, a friendly page will be displayed to the
user. That "waiting" page would periodically poll to see if the main
request is ready, eventually popping the stack and displaying the
results of the long running operation.

I've tried it briefly with Response.Redirect(...) to the waiting page
and then back to the main page, when it's done, but I lose all the post
back data. I also tried Server.Transfer(...) but saw the same effects.

One thing that crossed my mind - which is probably not possible, but
that's why I'm asking you here - was to do some kind of fork with the
output stream so that the response of the main page was written into a
database row (or some other persistence mechanism) while a waiting page
was returned to the user. That waiting page would periodically check
the status of the main request, and if it was complete it would return
the results back to the client.

If anyone's got any bright ideas, and would like to share them, I'd
really appreciate it.

Thanks,

Jono

 
Reply With Quote
 
 
 
 
Chris Fulstow
Guest
Posts: n/a
 
      10-05-2006
Check out the MSDN Magazine article about building asynchronous pages:
http://msdn.microsoft.com/msdnmag/is...10/WickedCode/

Jono wrote:
> Hi Everyone,
>
> As it says in the title, I'm looking for a way to display a page while
> long running operations are performed on the server. Ideally, I'd like
> some way to push the current request onto some stack, where it would
> continue to be processed asynchronously (most importantly preserving
> things like view state, form post data, etc). In the interim, while the
> main request is processed, a friendly page will be displayed to the
> user. That "waiting" page would periodically poll to see if the main
> request is ready, eventually popping the stack and displaying the
> results of the long running operation.
>
> I've tried it briefly with Response.Redirect(...) to the waiting page
> and then back to the main page, when it's done, but I lose all the post
> back data. I also tried Server.Transfer(...) but saw the same effects.
>
> One thing that crossed my mind - which is probably not possible, but
> that's why I'm asking you here - was to do some kind of fork with the
> output stream so that the response of the main page was written into a
> database row (or some other persistence mechanism) while a waiting page
> was returned to the user. That waiting page would periodically check
> the status of the main request, and if it was complete it would return
> the results back to the client.
>
> If anyone's got any bright ideas, and would like to share them, I'd
> really appreciate it.
>
> Thanks,
>
> Jono


 
Reply With Quote
 
 
 
 
Jono
Guest
Posts: n/a
 
      10-05-2006
Thanks Chris, but that appears to be a way of delaying the page's
rendering until multiple asynchronous operations complete, rather than
returning some interim HTML to the client to let them know that the
server's busy working on their request.

I've heard a lot about AJAX recently and I wonder if this isn't a
technology that might help in this situation.

Regards,

Jono

Chris Fulstow wrote:
> Check out the MSDN Magazine article about building asynchronous pages:
> http://msdn.microsoft.com/msdnmag/is...10/WickedCode/
>
> Jono wrote:
> > Hi Everyone,
> >
> > As it says in the title, I'm looking for a way to display a page while
> > long running operations are performed on the server. Ideally, I'd like
> > some way to push the current request onto some stack, where it would
> > continue to be processed asynchronously (most importantly preserving
> > things like view state, form post data, etc). In the interim, while the
> > main request is processed, a friendly page will be displayed to the
> > user. That "waiting" page would periodically poll to see if the main
> > request is ready, eventually popping the stack and displaying the
> > results of the long running operation.
> >
> > I've tried it briefly with Response.Redirect(...) to the waiting page
> > and then back to the main page, when it's done, but I lose all the post
> > back data. I also tried Server.Transfer(...) but saw the same effects.
> >
> > One thing that crossed my mind - which is probably not possible, but
> > that's why I'm asking you here - was to do some kind of fork with the
> > output stream so that the response of the main page was written into a
> > database row (or some other persistence mechanism) while a waiting page
> > was returned to the user. That waiting page would periodically check
> > the status of the main request, and if it was complete it would return
> > the results back to the client.
> >
> > If anyone's got any bright ideas, and would like to share them, I'd
> > really appreciate it.
> >
> > Thanks,
> >
> > Jono


 
Reply With Quote
 
Chris Fulstow
Guest
Posts: n/a
 
      10-05-2006
Jono

You could definitely achieve some thing like this using AJAX, check out
the ASP.NET AJAX Framework, in particular the UpdateProgress control.

http://atlas.asp.net/
http://atlas.asp.net/docs/Server/Mic...s/default.aspx

Jono wrote:
> Thanks Chris, but that appears to be a way of delaying the page's
> rendering until multiple asynchronous operations complete, rather than
> returning some interim HTML to the client to let them know that the
> server's busy working on their request.
>
> I've heard a lot about AJAX recently and I wonder if this isn't a
> technology that might help in this situation.
>
> Regards,
>
> Jono
>
> Chris Fulstow wrote:
> > Check out the MSDN Magazine article about building asynchronous pages:
> > http://msdn.microsoft.com/msdnmag/is...10/WickedCode/
> >
> > Jono wrote:
> > > Hi Everyone,
> > >
> > > As it says in the title, I'm looking for a way to display a page while
> > > long running operations are performed on the server. Ideally, I'd like
> > > some way to push the current request onto some stack, where it would
> > > continue to be processed asynchronously (most importantly preserving
> > > things like view state, form post data, etc). In the interim, while the
> > > main request is processed, a friendly page will be displayed to the
> > > user. That "waiting" page would periodically poll to see if the main
> > > request is ready, eventually popping the stack and displaying the
> > > results of the long running operation.
> > >
> > > I've tried it briefly with Response.Redirect(...) to the waiting page
> > > and then back to the main page, when it's done, but I lose all the post
> > > back data. I also tried Server.Transfer(...) but saw the same effects.
> > >
> > > One thing that crossed my mind - which is probably not possible, but
> > > that's why I'm asking you here - was to do some kind of fork with the
> > > output stream so that the response of the main page was written into a
> > > database row (or some other persistence mechanism) while a waiting page
> > > was returned to the user. That waiting page would periodically check
> > > the status of the main request, and if it was complete it would return
> > > the results back to the client.
> > >
> > > If anyone's got any bright ideas, and would like to share them, I'd
> > > really appreciate it.
> > >
> > > Thanks,
> > >
> > > Jono


 
Reply With Quote
 
Jono
Guest
Posts: n/a
 
      10-05-2006
There's one other caveat: some operations might take a very, very, long
time to complete and in such a case we want to give the user the option
of navigating to another part of the site (minimising the "waiting"
page to a small panel on the page, which will display "completed" when
the operation finishes). This opens another can of worms, especially if
we allow the user to close the browser and come back for their results
later. Basically, the output (with view state, form post data, etc)
from the pages needs to be stored in some kind of cache on the server,
probably keyed by user id. So, back to the beginning question ... is
there any way to divert the page's output to a memory-backed stream
rather than returning it back to the client over the network?

Chris Fulstow wrote:
> Jono
>
> You could definitely achieve some thing like this using AJAX, check out
> the ASP.NET AJAX Framework, in particular the UpdateProgress control.
>
> http://atlas.asp.net/
> http://atlas.asp.net/docs/Server/Mic...s/default.aspx
>
> Jono wrote:
> > Thanks Chris, but that appears to be a way of delaying the page's
> > rendering until multiple asynchronous operations complete, rather than
> > returning some interim HTML to the client to let them know that the
> > server's busy working on their request.
> >
> > I've heard a lot about AJAX recently and I wonder if this isn't a
> > technology that might help in this situation.
> >
> > Regards,
> >
> > Jono
> >
> > Chris Fulstow wrote:
> > > Check out the MSDN Magazine article about building asynchronous pages:
> > > http://msdn.microsoft.com/msdnmag/is...10/WickedCode/
> > >
> > > Jono wrote:
> > > > Hi Everyone,
> > > >
> > > > As it says in the title, I'm looking for a way to display a page while
> > > > long running operations are performed on the server. Ideally, I'd like
> > > > some way to push the current request onto some stack, where it would
> > > > continue to be processed asynchronously (most importantly preserving
> > > > things like view state, form post data, etc). In the interim, while the
> > > > main request is processed, a friendly page will be displayed to the
> > > > user. That "waiting" page would periodically poll to see if the main
> > > > request is ready, eventually popping the stack and displaying the
> > > > results of the long running operation.
> > > >
> > > > I've tried it briefly with Response.Redirect(...) to the waiting page
> > > > and then back to the main page, when it's done, but I lose all the post
> > > > back data. I also tried Server.Transfer(...) but saw the same effects.
> > > >
> > > > One thing that crossed my mind - which is probably not possible, but
> > > > that's why I'm asking you here - was to do some kind of fork with the
> > > > output stream so that the response of the main page was written into a
> > > > database row (or some other persistence mechanism) while a waiting page
> > > > was returned to the user. That waiting page would periodically check
> > > > the status of the main request, and if it was complete it would return
> > > > the results back to the client.
> > > >
> > > > If anyone's got any bright ideas, and would like to share them, I'd
> > > > really appreciate it.
> > > >
> > > > Thanks,
> > > >
> > > > Jono


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Having compilation error: no match for call to ‘(const __gnu_cxx::hash<long long int>) (const long long int&)’ veryhotsausage C++ 1 07-04-2008 05:41 PM
How to display page while long-running process executing? lmttag ASP .Net 14 04-19-2007 10:36 PM
stand-alone JMS, other JDBC operations, and transactions ( ActiveMQ + JOTM + JDBC operations ) Jesus M. Salvo Jr. Java 2 02-11-2006 06:33 PM
modify a long-running python script while it is running? Benjamin Rutt Python 2 12-20-2005 01:42 PM
How long to complete: while ($i<1e10){i++;} Jose Gomez Perl Misc 1 11-06-2004 07:20 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57