Page_Error() method (VB.net) : Page Error « Page « ASP.Net






Page_Error() method (VB.net)

<%@ Page Language="vb" %>
<html>
   <head>
      <title>Error event example</title>
      <script runat="server">
         Sub Page_Load()
            Dim x, y, overflow As Integer
            x = 1
            y = 0
            overflow = x / y
         End Sub
         Sub Page_Error()
            Response.Write(Server.GetLastError.ToString())
            Server.ClearError
         End Sub
      </script>
   </head>
<body>
   <asp:label id="Message" runat="server"/>
</body>
</html>
           
       








Related examples in the same category

1.Page.ErrorPage property (VB.net)
2.Page level error (C#)