progress indicator for asp.net
My asp.net application might run a long process(say anything between 20 seconds to 2 mins). Naturally, it it takes longer time,user gets impatient and try to hit the refresh button. I would like to show some kind of progress indicator either in the same window or a separate window(something like in expedia.com). Any idea how to do this in asp.net? or any place/article on how to do this?
thanks in advance
Monday, May 5, 2003
This might give you some ideas :
Monday, May 5, 2003
For the page in question do set <%@ Page Buffer="False"%> and in the event handler do a Response.Write of some content that says something like "Please wait..." - maybe an animated GIF of some sort to reassure the user that your page is actually "doing" something, and the Response.Flush so this content goes back to the user. Now call your lenghty proc. At this point the browser still has a connection so you can still Response.Write (and Flush) stuff back to them. When you're done you could Response.Write("<script>window.location='finished.aspx'</script>") to sent the browser to the "completed" page.
Bear in mind though that this won't scale very well (you are hogging a precious thread from the thead pool) and that ASP.NET might decide to recycle if it thinks there's a deadlock.
Maybe you ought to consider some sort of queued/batch mechanism whereby the user is notified via email or by periodically checking a status page.
Tuesday, May 6, 2003
Thanks for the link and I am going to try something like this.
I tried your option and it is ideal for our requirement. But as you mentioned, I am concerned about some queries which could take longer time. I am currently fine tuning the query which should improve the response time
I can not notify the users about the status as you mentioned due to our design/web site policy. Morever, we are planning to move the fat queries as separate ready-made reports and just give the link to the users if that is what they want.
Wednesday, May 7, 2003
Fog Creek Home