Roadmap › 1. .NET › Step 17
WF

ASP.NET Web Forms — Page Life Cycle, ViewState, Controls and State Management

How ASP.NET Web Forms works inside IIS (application and page life cycle), folder structure (App_Code, App_Data, App_Start, Bin, App_Themes), Web Site vs Web Application projects, .aspx/.aspx.cs code-behind, server controls and events, PostBack and ViewState, state management (ViewState, ControlState, Session, Application, Cache, cookies, query strings, hidden fields), validation controls, master pages, user controls and custom controls, data binding with GridView/Repeater and SqlDataSource vs ObjectDataSource, Global.asax and web.config, Forms authentication, custom errors, performance and migrating Web Forms to ASP.NET Core.
Quick revision for interview day. Print it or save it as a PDF.

Page life cycle

PreInit → Init → InitComplete → (LoadViewState, LoadPostData) → PreLoad → Load → control events → LoadComplete → PreRender → SaveStateComplete → Render → Unload.

Application pipeline

BeginRequest → Authenticate → Authorize → ResolveRequestCache → AcquireRequestState → PreRequestHandlerExecute → handler (Page) → PostRequestHandlerExecute → ReleaseRequestState → UpdateRequestCache → EndRequest.

State options

Page: ViewState/ControlState/hidden field · request: query string · browser: cookies · user: Session (InProc/StateServer/SQL/Redis) · all users: Application/Cache.

Folders & files

App_Code · App_Data · App_Start · App_Themes · App_GlobalResources · bin · .aspx + .aspx.cs + .designer.cs · .master · .ascx · .ashx · Global.asax · Web.config (+ transforms).

Errors

try/catch → Page_Error → Application_Error (log) → customErrors/httpErrors (friendly pages) · never debug="true" or customErrors="Off" in production.