Use Page Event

  • Thread starter Thread starter George
  • Start date Start date
G

George

How can I use an event of "Page" control other than the Page_Load?

I want to use the event "Unload" to execute some code when the page closes.
How can I declare it? The peculiar thing is when I declare the function in
the back code

protected void Unload(object sender, EventArgs e)
{
//*** Some Code
}

the function is executed during the Page Load process.

How can I control the closing of an aspx Page? Not with Javascript but with
C#

Thanks

George
 
asp.net does note really handle client events (it just fakes it).

asp.net sends html to the browser. at some point the browser may postback
the form data via the user hitting a sumbit button, or client javascript
calling form.submit(). an example of this is a linkbutton whicg uses
javascript, or setting autopostback on a dropdown.

the only to way really handle browser events is with javascript. there is no
event tired to browser close. the closest yu can get is page unload wich is
fired anytime a page in the browser is repolaced with another.

-- bruce (sqlwork.com)
 
Back
Top