Reputation: 31
When master page event fires, content page events are fired first,
Can anybody help me know, is there any content page event that fires after the master page events.
Upvotes: 1
Views: 3349
Reputation: 146
Event sequence:-
Content page PreInit event.
Master page controls Init event.
Content controls Init event.
Master page Init event.
Content page Init event.
Content page Load event.
Master page Load event.
Master page controls Load event.
Content page controls Load event.
Content page PreRender event.
Master page PreRender event.
Master page controls PreRender event.
Content page controls PreRender event.
Master page controls Unload event.
Content page controls Unload event.
Master page Unload event.
Content page Unload event.
Upvotes: 0
Reputation: 792
I guess what you are looking for is Events in ASP.NET Master and Content Pages. There are importatntly four events where content page events are fired after master page's related event:
Upvotes: 0
Reputation: 16613
Which event are you using already in the master page? There are most likely enough page events to consider which fire afterwards.
Take a look at the ASP.NET Page life cycle for it.
Edit after comment:
You can grab the Session data again in the content page in the PreRender event. However depending on your needs that may be too late in the life cycle already.
Besides this all, session state should be used between pages, not to pass data from a master page to a content page. Instead make use of the HttpContext.Items instead.
Yet another way is to raise a custom event from the master page and handle it in the content page.
Upvotes: 1