Try Catch Finally and Threads

Discussion in 'ASP .Net' started by Wayne, Jun 6, 2006.

  1. Wayne

    Wayne Guest

    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
     
    Wayne, Jun 6, 2006
    #1
    1. Advertisements

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

    What do you mean by monitoring of the thread?
     
    =?ISO-8859-1?Q?G=F6ran_Andersson?=, Jun 6, 2006
    #2
    1. Advertisements

  3. Wayne

    Winista Guest

    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.
     
    Winista, Jun 7, 2006
    #3
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.