Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 154675
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T10:01:15+00:00 2026-05-11T10:01:15+00:00

I have a asp.net 2.0 web app which calls a long running stored proc

  • 0

I have a asp.net 2.0 web app which calls a long running stored proc (about 3 minutes). The sp actually performs many tasks on the backend.

My page uses threading and ajax (update panel) and a timer control to dispaly a progess bar to the user. This all works great unless there is an error in the sp which just freezes the screen.

I have tried useing a SafeThread class which I found on codeProject which wraps the thread process and creates an event which can be handled in the case of an exception.

In the event handler I just want to redirect the user to an error page and display an error. When testing I can break in the event handler. Calling either Server.Transfer or Response.Redirect however, has no effect at all.

I am not sure why this happenning. I will post my code below. Any ideas or alternative suggestions appreciated.

    protected void btnSave_OnClick(object sender, EventArgs e)     {         DAC dac = new DAC();         Session['RerunStatus'] = 0;         SafeThread thrd = new SafeThread(new ParameterizedThreadStart(dac.RerunTest));         thrd.IsBackground = true;          //tell the SafeThread to report          //ThreadAbort exceptions         thrd.ShouldReportThreadAbort = true;         //attach a ThreadException handler for          //reporting SafeThread exceptions         thrd.ThreadException += new         ThreadThrewExceptionHandler(thrd_ThreadException);          thrd.Start(ddlRundate.SelectedItem.Text);         Session['RerunThread'] = thrd;         btnSave.Enabled = false;         Timer1.Enabled = true;     }      void thrd_ThreadException(SafeThread thrd, Exception ex)     {         //thrd.Abort();         Timer1.Enabled = false;         //Response.Redirect('ErrorPage.aspx');         Server.Transfer('ErrorPage.aspx?ErrorMsg=' + ex.Message);         //thrd.Abort();     } 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T10:01:16+00:00Added an answer on May 11, 2026 at 10:01 am

    You can only use Server.Transfer()/Response.Redirect() when handling a request – that is not the case when your thrd_ThreadException() get’s called.

    Try to set a flag in your thrd_ThreadException and do the redirect in the Timer1 Tick event.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an ASP.NET web app which is growing. It is done in traditional
I have an object which contains models for my ASP.NET MVC web app. The
The thing I have a web app (asp.net) which needs to have a feed.
I'm about to start writing a web app (Asp.Net/IIS7) which will be accessible over
I am currently developing an asp.net web app. I have a class which is
I have an asp.net update web app. Users go the the page, hit the
I have an ASP.NET 2.0 web app and part of the structure still has
In order to debug an asp.net web app I have to have IE Script
I have some configuration values for an asp.net web app. They will be maintained
I have a SQL Server 2000, C# & ASP.net web app. We want to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.