<%@ Page Language="vb" %>
<html>
<head>
<script runat="server">
Sub Page_Load()
Try
Dim myHttpEx As _
New HttpException("This is the original exception")
Dim myHttpEx2 As _
New HttpException("This is a nested exception", myHttpEx)
Throw New HttpException("Threw an exception from Page_Load", _
myHttpEx2)
Catch HttpEx As HttpException
Dim InnerHttpEx As HttpException
InnerHttpEx = HttpEx.InnerException
Message.Text = "ERROR:</br>"
Message.Text &= "Message: " & HttpEx.Message & "</br>"
Message.Text &= "Inner Exception Message: " & _
InnerHttpEx.Message & "</br>"
Message.Text &= "Base Exception Message: " & _
InnerHttpEx.GetBaseException.Message & "</br>"
End Try
End Sub
</script>
</head>
<body>
<asp:label id="Message" forecolor="red" runat="server"/>
</body>
</html>
|