Page Load error

  • Thread starter Thread starter Morten Snedker
  • Start date Start date
M

Morten Snedker

The Response.Redirect("default.aspx") produces an error with the
message "Thread was being aborted.".

What does that mean? Can/should I disregard it?

Try
If Not IsPostBack Then
If Session("JournalNr") <> "" Then
Call Initialize()
Else
Response.Redirect("default.aspx")
End If
End If
Me.txtSelskabsNavn.Focus()

Catch ex As Exception
MsgBox(Err.Number)
ReportError("Page_Load", ex.Message, Session("JournalNr"))
Exit Sub
End Try

Regards /Snedker
 
This questions has been asked dozens of times, a quick search could have
saved you time.

Directly from the documentation:
Redirect calls End which raises a ThreadAbortException exception upon
completion.

This means that calling this method always raises this exception - so if you
are catching all exceptions, you will catch this one as well. So either trap
only specific types of exceptions, or take the Redirect out of the Try
block.
 
This questions has been asked dozens of times, a quick search could have
saved you time.

Your're right - that was a lazy shortcut. Thanks for your reply,
though.

Regards /Snedker
 
Back
Top