HttpException("Threw an error from Page_Load", 100) : HttpException « Development « ASP.NET Tutorial






<%@ Page Language="vb" %>
<html>
<head>
   <script runat="server">
      Sub Page_Load()
         Try
            Throw New HttpException("Threw an error from Page_Load", 100)
         Catch HttpEx As HttpException
            Message.Text = "ERROR:</br>"
            Message.Text &= "Message: " & HttpEx.Message & "</br>"
            Message.Text &= "Error Code: " & HttpEx.ErrorCode & "</br>"
         End Try
      End Sub
   </script>
</head>
<body>
   <asp:label id="Message" forecolor="red" runat="server"/>
</body>
</html>








9.28.HttpException
9.28.1.Catch HttpException
9.28.2.HttpException("Threw an error from Page_Load", 100)
9.28.3.Get base exception
9.28.4.Get error message
9.28.5.GetHttpCode
9.28.6.HelpLink
9.28.7.InnerException
9.28.8.Exception Message
9.28.9.Source of exception
9.28.10.Stack trace
9.28.11.Target site
9.28.12.Convert Exception to string