J
James Hawthorne
Hi, I have created a asp.net web application and I hooked up page_unload so
I can clean up some things when i close it down.
The problem is, page_unload gets called when I first load the page, not when
I close it.
I know this because I put a breakpoint within the method, and it stops when
i first run it, not when I close.
private void Page_Unload(object sender, System.EventArgs e)
{
System.Diagnostics.Debug.WriteLine("closing");
}
private void InitializeComponent()
{
this.btnAdopt.Click += new System.EventHandler(this.btnAdopt_Click);
this.Load += new System.EventHandler(this.Page_Load);
this.Unload += new System.EventHandler(this.Page_Unload);
}
Any Ideas?
Thanks.
I can clean up some things when i close it down.
The problem is, page_unload gets called when I first load the page, not when
I close it.
I know this because I put a breakpoint within the method, and it stops when
i first run it, not when I close.
private void Page_Unload(object sender, System.EventArgs e)
{
System.Diagnostics.Debug.WriteLine("closing");
}
private void InitializeComponent()
{
this.btnAdopt.Click += new System.EventHandler(this.btnAdopt_Click);
this.Load += new System.EventHandler(this.Page_Load);
this.Unload += new System.EventHandler(this.Page_Unload);
}
Any Ideas?
Thanks.