Q:

BackGroundWorker not executing on background

When I load my page, I can only navigate after the background worker process is done... should it execute on background as the name say?
here is the code:
    protected void Page_Load(object sender, EventArgs e)
    {
        BackgroundWorker _bgk = new BackgroundWorker();
        _bgk.DoWork += new DoWorkEventHandler(DoWork_BackGroundWork);
        _bgk.RunWorkerCompleted += new RunWorkerCompletedEventHandler(WorkComplete_BackGroundWork);
        _bgk.RunWorkerAsync();
    }

    private void DoWork_BackGroundWork(object sender, DoWorkEventArgs e)
    {
        for (int i = 0; i < 99999; i++)
        {
            Trace.Write("STILL EXECUTING BACKGROUND WORKER");
        }
    }

    private void WorkComplete_BackGroundWork(object sender, RunWorkerCompletedEventArgs e)
    {
        Trace.Write("===================== BACKGROUND WORKER FINISHED ===================");
    }

A:

BackgroundWorker doesn't work with ASP.NET very well.
On top of that, unless you like playing with fire, launching background threads leaves the possibility open that IIS can recycle your thread without you knowing.  It's best to not use this type of threading in an ASP.NET environment (not saying ever, but it can be tricky to get correct)

A:

If anyone having the same problem as I am... Here is a good solution that worked like a charm for me.
http://www.codeproject.com/KB/cs/AsyncMethodInvocation.aspx
And here is a solution that worked even better:
http://weblogs.asp.net/albertpascual/archive/2009/05/14/fire-and-forget-class-for-asp-net.aspx
Both tested

