Unload events

T

TR

I'm coming to asp.net with mainly a desktop application background, and
would be grateful if someone could explain what is meant by "unload" in
asp.net . It's not the same as unload in a desktop application context. What
kinds of things are typically done in various unload eventhandlers (page
unload, form unload)?
Thanks
TR
 
B

Brock Allen

Every request into the webserver creates a new page object to handle that
one request. There are various events that fire on the page on each request
(Page_Init, Page_Load, etc). Page_Unload happens to be done of them. It's
meant to be a place to clean up any resources that you've not yet cleaned
up for the request. Typically, though, you probabaly should have already
cleaned up any resources by the time you get here (so in PageLoad, for example,
you typically open the DB connection, use it, then close it immediaetly).
So in the 4 years I've been doing ASP.NET development, I can't ever recall
using Page_Unload.
 

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,774
Messages
2,569,599
Members
45,175
Latest member
Vinay Kumar_ Nevatia
Top