DanGettel
asked on
How to End Protected Sub within Try Catch
I have two Try....Catches inside of a Protected Sub.
Inside the second Try....Catch I would like to End the Protected Sub if an error occurs.
How would I be able to do this?
Thanks in advance for the help.
Inside the second Try....Catch I would like to End the Protected Sub if an error occurs.
How would I be able to do this?
Thanks in advance for the help.
Try
smtpClient.Send(message)
Server.Transfer("confirm.aspx")
Catch ex As Exception
' Display error message
EmailProblemsLabel.Visible = True
EmailProblemsLabel.Text = "You have successfully made change, but there was a problem sending the email."
End Try
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
both of your suggestions should be correct. There must be something weird going on somewhere in the sub.
ASKER
I have tried using End Sub and Return and nothing seems to help.
What is happening is that when it hits the second Catch "Catch ex As System.Net.Mail.SmtpExcept
Thanks for any words of wisdom.
Open in new window