Problem with spawning new thread in ASP.NEt

N

n#

I have a long running task to be called from an aspx page.

My code segment

Dim ts As ThreadStart = New ThreadStart(AddressOf runLRProcessAsync)
Dim workerThread As Thread = New Thread(ts)
workerThread.Name = "LRProcess1"
workerThread.Start()
Response.Redirect("LRProcessResult.aspx?Refresh=N)


Everything works fine when the long running process is really a time
consuming operation.
But in some cases when the long running process is not really that
long, my response.redirect never gets executed.
I introduced aritifical slow downs by using Thread.Sleep. But of no
use.

Please help me.
 
G

Guest

Hi,
just try this one:
Response.Redirect("LRProcessResult.aspx?Refresh=N",True)

Thanks and Regards,
Manish Bafna.
MCP and MCTS.
 
N

n#

Actually i got the ThreadAbort Exception, but when I tried

Response.Redirect(url, false);
HttpContext.Current.ApplicationInstance.CompleteRequest();

Still my page freezes.
 

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

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top