Thursday, March 23, 2006
For site maintenance consider app_offline.htm
If you are making updates to your site and want to keep the users at bay with a polite notice then look no futher than the app_offline.htm file.
Create an HTML file called app_offline.htm, drop it in the root directory of your web, and your site will be offline with style.
Very early in the request cycle, ASP.NET 2.0 looks for the app_offline.htm file. If the file exists, ASP.NET stop processing requests for that application, unload it, and route all incoming requests to the app_offline.htm where your custom message awaits.
One handy side effect is the fact that this releases any locked resources such as databases in the app_data directory.
When finished, delete or even rename the app_offline.htm file to return users to their regularly scheduled browsing.
Create an HTML file called app_offline.htm, drop it in the root directory of your web, and your site will be offline with style.
Very early in the request cycle, ASP.NET 2.0 looks for the app_offline.htm file. If the file exists, ASP.NET stop processing requests for that application, unload it, and route all incoming requests to the app_offline.htm where your custom message awaits.
One handy side effect is the fact that this releases any locked resources such as databases in the app_data directory.
When finished, delete or even rename the app_offline.htm file to return users to their regularly scheduled browsing.
Saturday, March 11, 2006
ASP.NET 2.0 Page Lifecycle
It seems like I am always looking this up so here it is.
Table 1. Page Lifecycle methods
| Method | Active |
|---|---|
| Constructor | Always |
| Construct | Always |
| TestDeviceFilter | Always |
| AddParsedSubObject | Always |
| DeterminePostBackMode | Always |
| OnPreInit | Always |
| LoadPersonalizationData | Always |
| InitializeThemes | Always |
| OnInit | Always |
| ApplyControlSkin | Always |
| ApplyPersonalization | Always |
| OnInitComplete | Always |
| LoadPageStateFromPersistenceMedium | PostBack |
| LoadControlState | PostBack |
| LoadViewState | PostBack |
| ProcessPostData1 | PostBack |
| OnPreLoad | Always |
| OnLoad | Always |
| ProcessPostData2 | PostBack |
| RaiseChangedEvents | PostBack |
| RaisePostBackEvent | PostBack |
| OnLoadComplete | Always |
| OnPreRender | Always |
| OnPreRenderComplete | Always |
| SavePersonalizationData | Always |
| SaveControlState | Always |
| SaveViewState | Always |
| SavePageStateToPersistenceMedium | Always |
| Render | Always |
| OnUnload | Always |