|
-
Dec 7th, 2004, 06:15 PM
#1
Thread Starter
Frenzied Member
Handling a long process
As part of my app, I need to process a file the user uploads, which could take some time. So far I'm redirecting to a page that has an animated gif of a never ending progress bar, but I'm wondering what to do from there.
I can't really start my long process in the PageLoad event, because the page looks like it's hung. Doesn't seem to be a PageDoneLoading event, so I'm thinking of either a timer or a META refresh and redirect, or maybe spawning a thread to handle the process.
Is there an accepted way of doing this? Haven't tried yet, but unsure of how/if a spawned thread can redirect to a page that shows the result of the process.
Any ideas appreciated,
Mike
-
Dec 7th, 2004, 09:07 PM
#2
Thread Starter
Frenzied Member
Re: Handling a long process
Well, not sure if I'm doing this right, tried a few things. Timer didn't seen to work at all, that is, when the timer fired, I tried a Response.Redirect, and nothing happened, the page stayed where it is. Tried a META refresh, that just appeared to create a pause - the animated gif paused for a while, then finally went to the page. Didn't try threading (yet), but not sure if I need to, as I *think* I've got something that will work.
In the page load, I changed the Response.BufferedOutput to false, did a Response.Write to write a "please wait" message along with the img tag to show the animated gif, then a Response.Flush(). From there, looks like I can do some processing, then Response.Write() the status of what's going on. So as each step of the long process happens, I can write out what's going on and any informational messages.
I guess this will work, and it's cool because the user can see every step. I still have no idea of what the accepted method is. If anyone has any thoughts, I'd be interested.
-
Dec 7th, 2004, 09:17 PM
#3
Re: Handling a long process
In classic asp the method you used is the standard way of dealing with long process. I assume it would be one of the way you do it in asp.net too. Few weeks ago i tried something similar using threading but couldnt get it to work. I didnt try much though used something similar to your solution..
[VBF RSS Feed]
There is a great war coming. Are you sure you are on the right side? Atleast I have chosen a side.
If I have been helpful, Please Rate my Post. Thanks.
This post was powered by : 
-
Dec 7th, 2004, 09:28 PM
#4
Thread Starter
Frenzied Member
Re: Handling a long process
Thanks for the reply Danial. I searched a bunch and could never quite find an answer, good to know that it's ok to do. And it seems to work just fine.
Thanks,
Mike
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|