Use Page Event

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
 
B

bruce barker

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top