Where should stuff be done in an ASP.NET page?

asp.net, page-lifecycle

Solution

ASP.net page lifecycle

Problem

I'm very new to ASP.NET and, after beating my head on a few problems, I'm wondering if I'm doing things wrong (I've got a bad habit of doing that). I'm interested in learning about how ASP.NET operates. My question is: Where can I find documentation to guide me in deciding where to do what processing? As a few specific examples (I'm interested in answers to these but I'd rather be pointed at a resource that gives more general answers): - What processing should I do in `Page_Load`? - What processing should I do with the `Load` event? - What can I do in `Page_Unload`? - What order do things get done in? - When is each event fired? - What is the page life-cycle? edit: this question might also be of use to some people.

Original source