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