<html>
<title>第三十七例 编写global.asax举例</title>
<head>

  <script language="VB" runat="server">

      Sub Page_Load(Sender As Object, E As EventArgs)
         Response.Write("页面装载中()...<br>")
      End Sub

      Sub Session_Click(Sender As Object, E As EventArgs)
'忽略此次进程，页面重新指向本文件
         Session.Abandon()
         Response.Redirect("ex37VB.aspx")
      End Sub
'当页面产生错误时如何处理
      Sub Error_Click(Sender As Object, E As EventArgs)
         throw New Exception()
      End Sub

  </script>
</head>
  <body>

    <form runat="server">
      <input type="submit" Value="刷新页面" runat="server"/>
      <input type="submit" OnServerClick="Session_Click" Value="结束此次进程" runat="server"/>
      <input type="submit" OnServerClick="Error_Click" Value="进入错误页面" runat="server"/><p>
      <hr>
    </form>
    
  </body>

</html>

  