Mega Code Archive

 
Categories / ASP.Net Tutorial / Page Lifecycle
 

Error event example

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