Try Catch Finally and Threads

W

Wayne

I have code that Posts Form values to another page.

I am using a Try Catch Finally to handle thrown exceptions from our core
logic.

The problem is if everything is successful it Posts the page, the post has
to run inside the try catch statement; however, I get a ThreadException when
it trys to post and it just stops everything (no post).

BTW, this code works great if it is not in a try catch statement.

Is there a way I can stop monitoring of the thread and let everything else
continue to run?

I have tried the following and it does not work.


System.Threading.Thread.CurrentThread.ResetAbort
System.Threading.Thread.CurrentThread.Abort

System.Threading.Thread.CurrentThread.Suspend

System.Threading.Thread.CurrentThread.Sleep



Thanks!

-Wayne
 
?

=?ISO-8859-1?Q?G=F6ran_Andersson?=

What are you using to post the form data? HttpWebRequest? WebClient?

What do you mean by monitoring of the thread?
 
W

Winista

If its ThreadAbortException then ignore it. If you will try to redirect from
a page or cause the execution to shoft to another page, the thread has to
abort itself before it can start a new thread for the new page. It is by
design.
 

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,968
Messages
2,570,154
Members
46,702
Latest member
LukasConde

Latest Threads

Top