asp.net的页面的unload事件发生在何时?如何在编程中使用?

来源:百度知道 编辑:UC知道 时间:2024/06/14 04:41:23
最好能举例说明。谢谢了。

是页面对象的unload事件,发生在服务器端,没有用过。
试了一下,是这样的
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.ComponentModel;
using System.Text.RegularExpressions;
public partial class Z_kang_Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
this.Page.Unload += HaHa;
Response.Write(this.Session["1"].ToString());
}

protected void HaHa(object sender, EventArgs e)
{
//this.ClientScript.RegisterStartupScript(this.GetType(),"Alarm","alert('呜哈哈')",true);
//Response.Write("呜哈哈");
//this.TextBox1.Visible=false;