G
Gary W. Smith
I have a page that inherits from a base page that is currently
overriding all of the On* events. For the most part I'm accomplishing
everything I set out to do with the inheritance, but I wanted to get a
little more information to lock down what I think I know and also to
answer a couple little questions.
Given a base page, and the page inheriting it, as I understand it, the
page lifecycle flows like this:
1) Page is requested
2) Base page OnPreInit is called
3) Base page OnInit is called
4) Main page OnInit is called
5) ViewState is loaded
6) Base page OnPreLoad is called
7) Base page OnLoad is called
8) Main page OnLoad is called
9) Control postback events are processed
10) Base page OnLoadCompleted is called
11) Base page OnPreRender is called
12) Main page OnPreRender is called
13) Base page OnPreRenderComplete is called
14) ViewState is rendered
15) Base page OnUnload is called
16) Main page OnUnload is called.
I have run into some problems with Session though, not being available
during the Base page OnInit until after I have called base.OnInit(e).
My understanding is that Session should always be available, but I
also understand that it can't be available until after the cookies are
available, as the session id is derived from the cookie (and yes, I
know that Session is the root of all evils, but we are working to get
away from them in this app).
So is 1) the above sequence for page lifecycle correct and 2) what is
the session lifecycle on a page (i.e. when does it come in and out of
scope)?
Any help would be greatly appreciated.
Gary
overriding all of the On* events. For the most part I'm accomplishing
everything I set out to do with the inheritance, but I wanted to get a
little more information to lock down what I think I know and also to
answer a couple little questions.
Given a base page, and the page inheriting it, as I understand it, the
page lifecycle flows like this:
1) Page is requested
2) Base page OnPreInit is called
3) Base page OnInit is called
4) Main page OnInit is called
5) ViewState is loaded
6) Base page OnPreLoad is called
7) Base page OnLoad is called
8) Main page OnLoad is called
9) Control postback events are processed
10) Base page OnLoadCompleted is called
11) Base page OnPreRender is called
12) Main page OnPreRender is called
13) Base page OnPreRenderComplete is called
14) ViewState is rendered
15) Base page OnUnload is called
16) Main page OnUnload is called.
I have run into some problems with Session though, not being available
during the Base page OnInit until after I have called base.OnInit(e).
My understanding is that Session should always be available, but I
also understand that it can't be available until after the cookies are
available, as the session id is derived from the cookie (and yes, I
know that Session is the root of all evils, but we are working to get
away from them in this app).
So is 1) the above sequence for page lifecycle correct and 2) what is
the session lifecycle on a page (i.e. when does it come in and out of
scope)?
Any help would be greatly appreciated.
Gary