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.

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

MethodActive
ConstructorAlways
ConstructAlways
TestDeviceFilterAlways
AddParsedSubObjectAlways
DeterminePostBackModeAlways
OnPreInitAlways
LoadPersonalizationDataAlways
InitializeThemesAlways
OnInitAlways
ApplyControlSkinAlways
ApplyPersonalizationAlways
OnInitCompleteAlways
LoadPageStateFromPersistenceMediumPostBack
LoadControlStatePostBack
LoadViewStatePostBack
ProcessPostData1PostBack
OnPreLoadAlways
OnLoadAlways
ProcessPostData2PostBack
RaiseChangedEventsPostBack
RaisePostBackEventPostBack
OnLoadCompleteAlways
OnPreRenderAlways
OnPreRenderCompleteAlways
SavePersonalizationDataAlways
SaveControlStateAlways
SaveViewStateAlways
SavePageStateToPersistenceMediumAlways
RenderAlways
OnUnloadAlways

This page is powered by Blogger. Isn't yours?