By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,825 Members | 1,254 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,825 IT Pros & Developers. It's quick & easy.

An exception of type 'System.Threading.ThreadAbortException'

P: n/a
Hi All,

1)
I am using code like the below outside of the Try.. Catch... Endtry and getting this message
Within the Immediate Window.

An exception of type 'System.Threading.ThreadAbortException' occurred in mscorlib.dll but was not handled in user code
What can be done to avoid the above message?
Dim lIsMailwasExexuted As Boolean
Try
oSMTP.Send(oMailMessage)
lIsMailwasExexuted = True

Catch smtpEx As SmtpException
ClientScript.RegisterStartupScript(Me.GetType(), "E-Mail Problem", String.Format("Alert('There was a problem in sending the email: Please contact us by phone! {0}');", " " & smtpEx.Message.Replace("'", "\'")), True)

Catch generalEx As Exception
ClientScript.RegisterStartupScript(Me.GetType(), "General Problem", String.Format("alert('There was a general problem! Please contact us by phone! {0}');", " " & generalEx.Message.Replace("'", "\'")), True)
End Try

If lIsMailwasExexuted = True Then
Server.Transfer("Thankyou.htm", True)
Else
Server.Transfer("Display_Err_Message.htm", True)
End If

2) Since I move the code If lIsMailwasExexuted = True Then.... outside of the Try...Catch..EndTry then err message under the Catch is not displayed anymore.
Any idea why?

Thanks,

Joe






Dec 29 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Hi There,

Apprecaite any feedback.

Thanks,

Joe
Hi All,

1)
I am using code like the below outside of the Try.. Catch... Endtry and getting this message
Within the Immediate Window.

An exception of type 'System.Threading.ThreadAbortException' occurred in mscorlib.dll but was not handled in user code
What can be done to avoid the above message?
Dim lIsMailwasExexuted As Boolean
Try
oSMTP.Send(oMailMessage)
lIsMailwasExexuted = True

Catch smtpEx As SmtpException
ClientScript.RegisterStartupScript(Me.GetType(), "E-Mail Problem", String.Format("Alert('There was a problem in sending the email: Please contact us by phone! {0}');", " " & smtpEx.Message.Replace("'", "\'")), True)

Catch generalEx As Exception
ClientScript.RegisterStartupScript(Me.GetType(), "General Problem", String.Format("alert('There was a general problem! Please contact us by phone! {0}');", " " & generalEx.Message.Replace("'", "\'")), True)
End Try

If lIsMailwasExexuted = True Then
Server.Transfer("Thankyou.htm", True)
Else
Server.Transfer("Display_Err_Message.htm", True)
End If

2) Since I move the code If lIsMailwasExexuted = True Then.... outside of the Try...Catch..EndTry then err message under the Catch is not displayed anymore.
Any idea why?

Thanks,

Joe

Dec 31 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.