Click here to Skip to main content
15,886,199 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Images not displaying in IIS7 Pin
Curtis Schlak.9-Mar-09 12:50
Curtis Schlak.9-Mar-09 12:50 
GeneralRe: Images not displaying in IIS7 Pin
Member 34269369-Mar-09 12:52
Member 34269369-Mar-09 12:52 
AnswerRe: Images not displaying in IIS7 Pin
N a v a n e e t h9-Mar-09 15:47
N a v a n e e t h9-Mar-09 15:47 
GeneralRe: Images not displaying in IIS7 Pin
Member 342693610-Mar-09 5:19
Member 342693610-Mar-09 5:19 
AnswerRe: Images not displaying in IIS7 Pin
Cybernate11-Mar-09 6:51
Cybernate11-Mar-09 6:51 
GeneralRecord Audio Pin
Paul R Morrison9-Mar-09 10:33
Paul R Morrison9-Mar-09 10:33 
GeneralRe: Record Audio Pin
Christian Graus9-Mar-09 11:08
protectorChristian Graus9-Mar-09 11:08 
NewsPage event order: Please critique this info Pin
Gregory Gadow9-Mar-09 7:04
Gregory Gadow9-Mar-09 7:04 
I am putting together an article about master and content pages, and I want to make sure the info I'm including is correct. Also, if this is useful in any way, I can expand on it a bit and make it an article unto itself. The information has been culled from MS documentation, meaning that accuracy and completeness is iffy at best. So any comments or suggestions would be appreciated.

----------

As ASP files go from a request to something sent to the browser, several events are raised. All pages will raise the events I've marked below as Content and Page; Master events will be raised only if the page has a Master Page. Events marked as Page show where the server does something important and are not trappable events.

Content PreInit
The first capturable event. The Request and Response objects are available. IsPostBack and UICulture objects have been initialized. ViewState is not available. This is the only event where you can set the master page dynamically, as it occurs before any master page event has been raised. This is also when you would set the page's theme and create dynamically created controls.

Master Init
Initialize the master page and set any properties that it will require. ViewState is not available. Server controls on the master page have been fully initialized and can be accessed as needed, but the controls' values have not yet been set.

Content Init
Initialize the content page and set any properties that it will require. ViewState is not available. Server controls on the content page have been fully initialized and can be accessed as needed, but the controls' values have not yet been set.

Content InitComplete
The page has been fully initialized.

Page ViewStateRestore
This is not a trappable event. The ViewState is initialized. If the page request is a postback, the postback data is processed. Server controls with ViewState or postback data have their values set.

Content PreLoad
The ViewState has been restored and postback data has been set.

Content Load
The content page is being loaded. This event is usually where you set properties, open connections, etc. Note that the content page is loaded before the master page.

Master Load
The master page is being loaded. This event is usually where you set properties, open connections, etc. Note that the master page is loaded after the content page.

Page Validation
This is not a trappable event. If your page has any Validation controls, the Validate method is called on them.

Page HandlePostBack
This not a trappable event. After the page's controls have been validated and before rendering begins, any postback events such as button clicks are handled.

Content LoadComplete
The page has been completely loaded.

Page PreRender
This is not a trappable event. The EnsureChildControls method is called on all server controls, on the content page and on the master page. The BindData method is called on controls that are data-bound.

Content PreRender
The page is about to be rendered. Perform final changes to server controls, and save any data you want to persist to the ViewState.

Master PreRender
The page is about to be rendered. Perform final changes to server controls, and save any data you want to persist to the ViewState.

Content PreRenderComplete
This is your last chance to change the page's content; subsequent changes to the page will be ignored.

Content SaveStateComplete
This is your last chance to persist data to the ViewState.

Page Render
This is not a trappable event. The Render method is called on all server controls on the page. In-line commands (those noted in the HTML with <% %> Wink | ;) are executed top down.

Master Unload
The page has finished rendering. If you opened any files or data connections for rendering the page, now would be the time to close them and free resources. Use of the Response, Request and ViewState objects will throw an exception. Please note that this event has nothing to do with browser navigation.

Content Unload
The page has finished rendering. If you opened any files or data connections for rendering the page, now would be the time to close them and free resources. Use of the Response, Request and ViewState objects will throw an exception. Please note that this event has nothing to do with browser navigation.

Content Disposed
The cycle is complete, and the page has been fully rendered. Please note that this event has nothing to do with browser navigation.

Master Disposed
The cycle is complete, and the page has been fully rendered. Please note that this event has nothing to do with browser navigation.

When you have nested master pages, the inner master page is treated as the contents of the outer master page. So if you had Content.asp with a master page of Inner.master which, in turn, has a master page Outer.master, the events would be:

Content PreInit
Outer Init (master master)
Inner Init (Outer's content)
Content Init (Inner's content)
Content InitComplete
Page ViewStateRestore
Content PreLoad
Content Load
Inner Load (Content's master)
Outer Load (Inner's master)
Page Validation
Page HandlePostBack
Content LoadComplete
Page PreRender
Content PreRender
Inner PreRender (Content's master)
Outer PreRender (Inner's master)
Content PreRenderComplete
Content SaveStateComplete
Page Render
Outer Unload (master master)
Inner Unload (Outer's content)
Content Unload (Inner's content)
Content Disposed
Inner Disposed (Content's master)
Outer Disposed (Inner's master)

----------
GeneralRe: Page event order: Please critique this info Pin
Anurag Gandhi9-Mar-09 19:50
professionalAnurag Gandhi9-Mar-09 19:50 
QuestionHttpException The file '/MyControls/Web/GUI/Controls/PageHead.ascx' does not exist. at System.Web.UI.Util.CheckVirtualFileExists(VirtualPath virtualPath) Pin
thomasa9-Mar-09 6:49
thomasa9-Mar-09 6:49 
AnswerRe: HttpException The file '/MyControls/Web/GUI/Controls/PageHead.ascx' does not exist. at System.Web.UI.Util.CheckVirtualFileExists(VirtualPath virtualPath) Pin
Christian Graus9-Mar-09 11:48
protectorChristian Graus9-Mar-09 11:48 
QuestionCreate random Number Pin
ptvce9-Mar-09 3:20
ptvce9-Mar-09 3:20 
AnswerRe: Create random Number Pin
Abhijit Jana9-Mar-09 3:28
professionalAbhijit Jana9-Mar-09 3:28 
GeneralRe: Create random Number Pin
scottgp9-Mar-09 5:09
professionalscottgp9-Mar-09 5:09 
GeneralRe: Create random Number Pin
Christian Graus9-Mar-09 11:09
protectorChristian Graus9-Mar-09 11:09 
AnswerRe: Create random Number Pin
N a v a n e e t h9-Mar-09 4:09
N a v a n e e t h9-Mar-09 4:09 
AnswerRe: Create random Number Pin
Jack Li9-Mar-09 4:59
Jack Li9-Mar-09 4:59 
GeneralRe: Create random Number Pin
N a v a n e e t h9-Mar-09 5:09
N a v a n e e t h9-Mar-09 5:09 
GeneralRe: Create random Number Pin
Abhishek Sur9-Mar-09 6:04
professionalAbhishek Sur9-Mar-09 6:04 
AnswerRe: Create random Number Pin
Perisic, Aleksandar9-Mar-09 7:55
Perisic, Aleksandar9-Mar-09 7:55 
GeneralRe: Create random Number Pin
Yusuf9-Mar-09 8:20
Yusuf9-Mar-09 8:20 
GeneralRe: Create random Number [modified] Pin
Perisic, Aleksandar9-Mar-09 9:05
Perisic, Aleksandar9-Mar-09 9:05 
GeneralRe: Create random Number Pin
Yusuf9-Mar-09 10:54
Yusuf9-Mar-09 10:54 
GeneralRe: Create random Number Pin
Perisic, Aleksandar9-Mar-09 11:44
Perisic, Aleksandar9-Mar-09 11:44 
QuestionMake Browser Window Blink in Task Bar Pin
rushi_gavankar9-Mar-09 3:18
rushi_gavankar9-Mar-09 3:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.