Thread was being aborted

J

Josef K.

I've started getting "Thread was being aborted" errors. This errormessage
has me puzzled. I'm using the same very simple approach throughout the
application, and it works elsewhere:

-- my aspx form declares an instance of a data-layer class with form-level
scope

Protected WithEvents MyDataLayer as DataLayer

-- and a new instance of the class is created in Page_Load:

MyDataLayer = New DataLayer
AddHandler MyDataLayer.Success, AddressOf OnSuccess

-- on the aspx form, a Save button onclick eventhandler invokes a method in
the datalayer class

MyDataLayer.DoSomething()

-- the data layer's DoSomething() method executes a stored procedure against
SQL Server and raises either a Success or Failure event

RaiseEvent Success(args as DataLayer.SuccessArgs)

-- a subroutines on the aspx form listens for the success event:

Private Sub OnSuccess(args as DataLayer.SuccessArgs)
Try
'// on Success, we want to go to another page;
'// none of the following alternatives works:

Response.Redirect("SomeOtherPage.aspx", False)
Response.Redirect("SomeOtherPage.aspx", True)
Server.Transfer("SomeOtherPage.aspx", False)
Server.Transfer("SomeOtherPage.aspx", True)

Catch ex as Exception
'// always thread was being aborted error
End Try
End Sub

How do I fix this? Is it a timing issue not under programmer's control?
Thanks
K.
 

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

Ask a Question

Top