Error event example : Page Events « Page Lifecycle « ASP.NET Tutorial






<%@ 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>








5.3.Page Events
5.3.1.Here is the sequence of events that are raised whenever you request a page:
5.3.2.Error event example
5.3.3.Page events firing sequence (VB.net)
5.3.4.Page life cycle events
5.3.5.Page flow tracing
5.3.6.Unload event example