3、MasterPage1的Page_Unload
4、Default1的Page_Unload
说明:经过一下代码测试得到结果,在每个页面上加上一下代码。
如果有些只是一点的话,这说明该事件只有该对象才有。
protected void Page_Load(object sender, EventArgs e)
{
DoIndex();
System.Diagnostics.Debug.WriteLine(Session["index"].ToString() + " 、 " + this.ToString() + " : Page_Load");
}
protected void Page_Unload(object sender, EventArgs e)
{
DoIndex();
System.Diagnostics.Debug.WriteLine(Session["index"].ToString() + " 、 " + this.ToString() + " : Page_Unload");
}
protected void Page_SaveStateComplete(object sender, EventArgs e)
{
DoIndex();
System.Diagnostics.Debug.WriteLine(Session["index"].ToString() + " 、 " + this.ToString() + " : Page_SaveStateComplete");
}
protected void Page_PreRenderComplete(object sender, EventArgs e)
{
DoIndex();
System.Diagnostics.Debug.WriteLine(Session["index"].ToString() + " 、 " + this.ToString() + " : Page_PreRenderComplete");
}
protected void Page_PreRender(object sender, EventArgs e)
{
DoIndex();
System.Diagnostics.Debug.WriteLine(Session["index"].ToString() + " 、 " + this.ToString() + " : Page_PreRender");
}
protected void Page_PreLoad(object sender, EventArgs e)
{
DoIndex();
System.Diagnostics.Debug.WriteLine(Session["index"].ToString() + " 、 " + this.ToString() + " : Page_PreLoad");
}
protected void Page_PreInit(object sender, EventArgs e)
{
DoIndex();
System.Diagnostics.Debug.WriteLine(Session["index"].ToString() + " 、 " + this.ToString() + " : Page_PreInit");
}
protected void Page_LoadComplete(object sender, EventArgs e)
{
DoIndex();
System.Diagnostics.Debug.WriteLine(Session["index"].ToString() + " 、 " + this.ToString() + " : Page_LoadComplete");
}
protected void Page_InitComplete(object sender, EventArgs e)
{
DoIndex();
System.Diagnostics.Debug.WriteLine(Session["index"].ToString() + " 、 " + this.ToString() + " : Page_InitComplete");
}
protected void Page_Init(object sender, EventArgs e)
{
DoIndex();
System.Diagnostics.Debug.WriteLine(Session["index"].ToString() + " 、 " + this.ToString() + " : Page_Init");
}
protected void Page_Error(object sender, EventArgs e)
{
DoIndex();
System.Diagnostics.Debug.WriteLine(Session["index"].ToString() + " 、 " + this.ToString() + " : Page_Error");
}
protected void Page_Disposed(object sender, EventArgs e)
{
DoIndex();
System.Diagnostics.Debug.WriteLine(Session["index"].ToString() + " 、 " + this.ToString() + " : Page_Disposed");
}
protected void Page_DataBinding(object sender, EventArgs e)
{
DoIndex();
System.Diagnostics.Debug.WriteLine(Session["index"].ToString() + " 、 " + this.ToString() + " : Page_DataBinding");
}
protected void Page_CommitTransaction(object sender, EventArgs e)
{
DoIndex();
System.Diagnostics.Debug.WriteLine(Session["index"].ToString() + " 、 " + this.ToString() + " : Page_CommitTransaction");
}
protected void Page_AbortTransaction(object sender, EventArgs e)
{
DoIndex();
System.Diagnostics.Debug.WriteLine(Session["index"].ToString() + " 、 " + this.ToString() + " : Page_AbortTransaction");
}
private void DoIndex()
{
if (Session["index"] == null)
{
Session["index"] = 1;
}
else
{
string strIndex = Session["index"].ToString();
int index = Convert.ToInt32(strIndex);
index = index + 1;
Session["index"] = index;
}
}