Any elegant way of doing this?

  • Thread starter Morten Wennevik
  • Start date
M

Morten Wennevik

Hi,

Upon clicking a button I perform some heavy server side calculations lasting up to five minutes. During this time, the web page appear to be loading the response page.

Is there some elegant way to show progress to the user? The server side calculations are done in four separate methods. I imagine the user might be interested in knowing when one method is done and the next is running.

Javascript and threading?

Morten
 
G

Guest

Do a search on "Wait Message" and you should get plenty of hits...
Typically what you do is a Response.Flush() to force what you have to the
screen (I usually use a animated GIF) and then the page will continue to
process.
If your code takes 5 min to execute you may want to kick it off
independantly though, and let the user continue on and check back later for
the results.
 
S

S.M. Altaf [MVP]

Morten,

I feel that you'll need to make a tradeoff somewhere between
elegance+simplicity and accuracy+load. Your first option is to create a
real simple PLEASE WAIT page with some details on it and the time it might
take.

But if you want the user to know what's going on when, then you can use
Resonse.Flush()es to write chunks of text to the browser indicating the
processes that have been performed. (Look at www.wwhois.com to see what I
mean)

And yet another option would be to use XMLHTTP to perform requests to the
page with your 4 operations, and updating content in your calling page as
and when a process is complete.

The last two methods can prove to be 'heavy' on the server, and if you have
a *LOT* of visitors on your site, then you shouldn't consider it. Else,
have fun implementing it.

HTH
Altaf
 
M

Morten Wennevik

Do a search on "Wait Message" and you should get plenty of hits...
Typically what you do is a Response.Flush() to force what you have to the
screen (I usually use a animated GIF) and then the page will continue to
process.
If your code takes 5 min to execute you may want to kick it off
independantly though, and let the user continue on and check back later for
the results.


Thanks, I'll look into it
 
M

Morten Wennevik

Thanks, I'll look into it

Morten,

I feel that you'll need to make a tradeoff somewhere between
elegance+simplicity and accuracy+load. Your first option is to create a
real simple PLEASE WAIT page with some details on it and the time it might
take.

But if you want the user to know what's going on when, then you can use
Resonse.Flush()es to write chunks of text to the browser indicating the
processes that have been performed. (Look at www.wwhois.com to see what I
mean)

And yet another option would be to use XMLHTTP to perform requests to the
page with your 4 operations, and updating content in your calling page as
and when a process is complete.

The last two methods can prove to be 'heavy' on the server, and if you have
a *LOT* of visitors on your site, then you shouldn't consider it. Else,
have fun implementing it.

HTH
Altaf
 

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

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,040
Latest member
papereejit

Latest Threads

Top