Download presentation
Presentation is loading. Please wait.
Published byGervase Simmons Modified over 8 years ago
1
ASP.NET Architecture Mike Taulty Developer & Platform Group Microsoft Ltd mtaulty@microsoft.com http://mtaulty.com
2
HTTP.sys Serving up HTTP Internet Information Server WWW Service Config Mgr Process Mgr INETINFO metabase Worker Process ISAPI Extension ISAPI Extension ISAPI Filter Worker Process ASP.NET ISAPI ASP.NET ISAPI CLR Application Domain Configure/Monitor
3
ASP.NET ISAPI HTTP.sys ASP.NET Bridging IIS to the world of.NET code HttpModule HttpHandler Web Services (.asmx) Web Services (.asmx) Web Pages (.aspx) Web Pages (.aspx) Web Controls (.ascx) Web Controls (.ascx) Custom (.?) Custom (.?)
4
Writing Http Handlers
5
ASP.NET Web Forms Server controls encapsulate behaviour Provide VB-Like Model Support compiled languages VB, C#, JScript, COBOL, etc. Enable separation of code from content Developers and designers can work independently Support multiple clients automatically Rich DHTML, HTML 3.2, etc… Mobile controls for small devices
6
Web Forms: Key Concepts Server controls Encapsulate UI generation, user interaction Fire events for state changes Page execution is “staged”, not linear Page fires events for phases of processing Init, Load, Render, Unload, etc Event handler code Handles events raised by controls, page Can be located in-line, or in separate file or DLL
7
Web Form Server Controls Server controls encapsulate behavior Declarative, tag with runat="server" Generate HTML that is sent to the client Can support multiple client types DHTML, HTML 3.2, WML, etc. Process input sent from client Bind to data in Forms collection Fire events for notifications
8
Web Form Server Controls Allow look and feel to be customized Template properties allow fine grained control Templates are UI fragments (Header, Item, etc.) Are stateless on the server Controls can store needed state in a ViewState ViewState travels with the page or URL
9
Simple ASP.NET Pages
10
HTTP.sys ASP.NET Page Execution Cycle Request.aspx Code Behind Request.aspx Control <html> </html> Generate Code Generate Code Compile (VB/C#) Compile (VB/C#) Assembly Page txtform Name: Name:.ASPX Page LiteralControl Page TextBox HtmlForm
11
HTTP.sys ASP.NET Page Execution Cycle Request.aspx Assembly Page Ctl1Ctl2 PageChanged? Re-use Cached?
12
Tag-Based Persistence Tags parsed at runtime Control instance created Properties set from tag attributes & child tags first item first item second item second item third item third item Class to create Marks tag as a server control Namespace reference ID of the instance Sets the liststyle property on l1 Sets the Items property on l1
13
Control Processing – First Load Init Load PreRender SaveViewState Render Dispose Each control instantiated, set to initial state, added to control tree User code runs, tests !IsPostBack condition to data bind 1 st values CreateChildControls() ensures controls are ready to render Controls save current state (if different than initial values) Each control renders itself to the Response Pages and all controls are disposed
14
Control Processing – Post Back Init Load PreRender SaveViewState Render Dispose Last state of the controls is restored from ViewState values Posted data (in the HTTP form) is passed to its associated control Events are fired for controls in tree order, except the event that caused the post. It’s fired last. LoadViewState Postback data Postback events
15
ASP.NET Web Forms
16
ASP.NET Application Services Application & Session State Session state storage choice Caching Flexible data cache Parameterised output caching for pages and controls Data Binding Diagnostics Applicaton & Page Level tracing system Performance monitor counters Security Authentication and Authorization Configuration System
17
Resources Web Forms http://msdn.microsoft.com/asp.net www.asp.net http://www.asp.net/tutorials/quickstart.aspx http://www.4guysfromrolla.com http://www.123aspx.com
18
© 2004 Microsoft Limited. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.