Try Catch Finally and Threads

  • Thread starter Thread starter Wayne
  • Start date Start date
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
 
What are you using to post the form data? HttpWebRequest? WebClient?

What do you mean by monitoring of the thread?
 
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.
 
Back
Top