Users Pricing

forum

home / developersection / forums / asp.net kills my background thread?

ASP.NET kills my background thread?

Anonymous User 1915 17 Nov 2014

I have the following code in my codebehind (aspx.cs):

protected void button1_Click(object sender, EventArgs e)
{
    new Thread(delegate() {
        try
        {
            Thread.Sleep(30000); //do nothing for 30 seconds
        }
        catch (Exception ex)
        {
            //I AWLAYS get a ThreadAbortException here
            //in about 1 second WHY!?!??!
        }
    }).Start();
}

Please help me


I am a content writter !


1 Answers

Markdown for AI

A clean, structured version of this page for AI assistants and LLMs.

Open .md