Page level error : Diagnose Error « Development « ASP.Net






Page level error

<script language="VB" runat="server">
  Sub PageLevelErrorTest()
    Dim intCounter as integer
    intCounter =1
    For intCounter=1 To 10
      intCounter = intCounter+1
    Next
    Response.Write ("The value of the counter is:" & intCounter & "<br>")
    intCounter = "Storing a string to an integer"
  End Sub

  Sub Page_Error(sender As Object, exc As EventArgs)
    Response.Write("Error occurred: " & Server.GetLastError().ToString())
    Server.ClearError()
  End Sub

  Sub Page_Load()
    PageLevelErrorTest()
  End Sub
</script>

           
       








Related examples in the same category

1.Diagnose error Demo