An exception of type "System.Threading.ThreadAbortException"

An exception of type "System.Threading.ThreadAbortException"

am 29.12.2007 04:35:08 von Adrian

This is a multi-part message in MIME format.

------=_NextPart_000_0016_01C849A1.E69CB0D0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi All,

1)
I am using code like the below outside of the Try.. Catch... Endtry and =
getting this message=20
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 =3D 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 =3D 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 =3D True Then.... =
outside of the Try...Catch..EndTry then err message under the Catch is =
not displayed anymore.=20
Any idea why?

Thanks,

Joe
















------=_NextPart_000_0016_01C849A1.E69CB0D0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable



charset=3Diso-8859-1">




Hi All,

 

1)

I am using code like the below outside =
of the Try..=20
Catch... Endtry and getting this message


style=3D"FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-no-proof: =
yes"> face=3DArial size=3D2>Within the Immediate Window.



style=3D"FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-no-proof: =
yes"> face=3DArial size=3D2>An exception of type=20
'System.Threading.ThreadAbortException' occurred in mscorlib.dll but was =
not=20
handled in user code

size=3D2>


size=3D2> face=3DArial color=3D#000000>What can be done to avoid the above=20
message?


size=3D2> face=3DArial color=3D#000000> color=3D#000000> face=3DArial color=3D#000000>
Dim =
lIsMailwasExexuted=20
As =
color=3D#0000ff size=3D2>Boolean


size=3D2> face=3DArial color=3D#000000> color=3D#000000> face=3DArial color=3D#000000> color=3D#000000>
Try
   =20
oSMTP.Send(oMailMessage)
    =
lIsMailwasExexuted =
True


color=3D#0000ff=20
size=3D2>

    =
Catch
size=3D2> smtpEx
As size=3D2>=20
SmtpException
       =20
ClientScript.RegisterStartupScript(
size=3D2>Me.GetType(), color=3D#800000=20
size=3D2>"E-Mail Problem"
, color=3D#0000ff=20
size=3D2>String
.Format( color=3D#800000=20
size=3D2>"Alert('There was a problem in sending the email: Please =
contact us by=20
phone! {0}');"
, size=3D2>"=20
"
& smtpEx.Message.Replace( color=3D#800000=20
size=3D2>"'"
, size=3D2>"\'")), size=3D2>True)


    =
Catch
size=3D2> generalEx
As size=3D2>=20
Exception
size=3D2>      =20
ClientScript.RegisterStartupScript(
size=3D2>Me.GetType(), color=3D#800000=20
size=3D2>"General Problem"
, color=3D#0000ff=20
size=3D2>String
.Format( color=3D#800000=20
size=3D2>"alert('There was a general problem! Please contact us by =
phone!=20
{0}');"
, " =
"
size=3D2> & generalEx.Message.Replace(
size=3D2>"'", size=3D2>"\'")), size=3D2>True)
End color=3D#000000=20
size=3D2>
Try


If lIsMailwasExexuted =3D color=3D#0000ff=20
size=3D2>True
size=3D2>Then
   =20
Server.Transfer(
size=3D2>"Thankyou.htm" size=3D2>, True size=3D2>)
Else

size=3D2>    Server.Transfer(

size=3D2>"Display_Err_Message.htm"
, color=3D#0000ff=20
size=3D2>True
)
size=3D2>End size=3D2>If


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


Thanks,


Joe


 


 


 


color=3D#000000> 


 

style=3D"MARGIN: 0in 0in 0pt"> style=3D"FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-no-proof: =
yes"> face=3DArial size=3D2> 


style=3D"FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-no-proof: =
yes"> face=3DArial size=3D2> 


style=3D"FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-no-proof: =
yes"> face=3DArial size=3D2> 



------=_NextPart_000_0016_01C849A1.E69CB0D0--

Re: An exception of type "System.Threading.ThreadAbortException"

am 31.12.2007 01:27:20 von Adrian

This is a multi-part message in MIME format.

------=_NextPart_000_002C_01C84B19.FFBA1570
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

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=20
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 =3D 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 =3D 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 =3D True Then.... =
outside of the Try...Catch..EndTry then err message under the Catch is =
not displayed anymore.=20
Any idea why?

Thanks,

Joe

------=_NextPart_000_002C_01C84B19.FFBA1570
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable



charset=3Diso-8859-1">




Hi There,

 

Apprecaite any feedback.

 

Thanks,

 

Joe

style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Hi All,

 

1)

I am using code like the below =
outside of the=20
Try.. Catch... Endtry and getting this message


style=3D"FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-no-proof: =
yes"> face=3DArial size=3D2>Within the Immediate Window.



style=3D"FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-no-proof: =
yes"> face=3DArial size=3D2>An exception of type=20
'System.Threading.ThreadAbortException' occurred in mscorlib.dll but =
was not=20
handled in user code

size=3D2>


color=3D#0000ff=20
size=3D2>What can be done to avoid =
the above=20
message?


color=3D#0000ff=20
size=3D2> color=3D#000000> face=3DArial=20
color=3D#000000>

Dim
=
lIsMailwasExexuted=20
As =
color=3D#0000ff size=3D2>Boolean


color=3D#0000ff=20
size=3D2> color=3D#000000> face=3DArial=20
color=3D#000000>

Try
   =20
oSMTP.Send(oMailMessage)
    =
lIsMailwasExexuted=20
=3D
size=3D2>True


color=3D#0000ff=20
size=3D2>

    =
Catch
size=3D2> smtpEx
As size=3D2>=20
SmtpException
       =20
ClientScript.RegisterStartupScript(
size=3D2>Me.GetType(), color=3D#800000=20
size=3D2>"E-Mail Problem"
, color=3D#0000ff=20
size=3D2>String
.Format( color=3D#800000=20
size=3D2>"Alert('There was a problem in sending the email: Please =
contact us by=20
phone! {0}');"
, size=3D2>"=20
"
& smtpEx.Message.Replace( color=3D#800000=20
size=3D2>"'"
, size=3D2>"\'")), size=3D2>True)


    =
Catch
size=3D2> generalEx
size=3D2>As=20
Exception
size=3D2>      =20
ClientScript.RegisterStartupScript(
size=3D2>Me.GetType(), color=3D#800000=20
size=3D2>"General Problem"
, color=3D#0000ff=20
size=3D2>String
.Format( color=3D#800000=20
size=3D2>"alert('There was a general problem! Please contact us by =
phone!=20
{0}');"
, " =
"
size=3D2> & generalEx.Message.Replace(

size=3D2>"'"
, size=3D2>"\'")), size=3D2>True)
End color=3D#000000 size=3D2> size=3D2>Try


If lIsMailwasExexuted =3D color=3D#0000ff=20
size=3D2>True
size=3D2>Then
   =20
Server.Transfer(
size=3D2>"Thankyou.htm" size=3D2>, True size=3D2>)
size=3D2>Else
size=3D2>    Server.Transfer( color=3D#800000=20
size=3D2>"Display_Err_Message.htm"
,
color=3D#0000ff size=3D2>True
)
color=3D#0000ff=20
size=3D2>End
size=3D2>If


2) Since I =
move the code=20
If lIsMailwasExexuted  =3D color=3D#0000ff=20
size=3D2>True
size=3D2>Then....
 outside of the =
Try...Catch..EndTry=20
then err message under the Catch is not displayed=20
anymore.
 
Any idea =
why?


Thanks,


Joe



------=_NextPart_000_002C_01C84B19.FFBA1570--