nicholas goossens r&d lead open box software session code: wux302
TRANSCRIPT
![Page 1: Nicholas Goossens R&D Lead Open Box Software Session Code: WUX302](https://reader037.vdocument.in/reader037/viewer/2022103122/56649f565503460f94c7a754/html5/thumbnails/1.jpg)
![Page 2: Nicholas Goossens R&D Lead Open Box Software Session Code: WUX302](https://reader037.vdocument.in/reader037/viewer/2022103122/56649f565503460f94c7a754/html5/thumbnails/2.jpg)
Understanding ASP.NET Under The Covers
Nicholas GoossensR&D LeadOpen Box SoftwareSession Code: WUX302
![Page 3: Nicholas Goossens R&D Lead Open Box Software Session Code: WUX302](https://reader037.vdocument.in/reader037/viewer/2022103122/56649f565503460f94c7a754/html5/thumbnails/3.jpg)
How does it work?
![Page 4: Nicholas Goossens R&D Lead Open Box Software Session Code: WUX302](https://reader037.vdocument.in/reader037/viewer/2022103122/56649f565503460f94c7a754/html5/thumbnails/4.jpg)
Classic ASP
ASP.NetAuthentication
Page Lifecycle
AJAX Controls
.aspx
.ashx
Handlers
User Controls
Custom Controls
Browser Targeting
Doc Types
Services
Master Pages
Client Script
Request
Response
Parsing
![Page 5: Nicholas Goossens R&D Lead Open Box Software Session Code: WUX302](https://reader037.vdocument.in/reader037/viewer/2022103122/56649f565503460f94c7a754/html5/thumbnails/5.jpg)
Agenda
ASP from Then till NowBuzzwordsRequest-to-Response WalkthroughASP.Net ExtrasSummary
![Page 6: Nicholas Goossens R&D Lead Open Box Software Session Code: WUX302](https://reader037.vdocument.in/reader037/viewer/2022103122/56649f565503460f94c7a754/html5/thumbnails/6.jpg)
Classic ASP
Interpreted languageIncluded embedded scripting code mixed into HTMLLimited to VBScriptRan in the same process as IISInherently not scalable (needed MTS)
![Page 7: Nicholas Goossens R&D Lead Open Box Software Session Code: WUX302](https://reader037.vdocument.in/reader037/viewer/2022103122/56649f565503460f94c7a754/html5/thumbnails/7.jpg)
![Page 8: Nicholas Goossens R&D Lead Open Box Software Session Code: WUX302](https://reader037.vdocument.in/reader037/viewer/2022103122/56649f565503460f94c7a754/html5/thumbnails/8.jpg)
ASP.Net Beginnings
Designed by Scott Guthrie & Mark AndersOriginally known as XSP
Not .NET-related – Java based !Became ASP+ with the design of the CLR
Rewritten in C#Renamed when .NET branding introduced
![Page 9: Nicholas Goossens R&D Lead Open Box Software Session Code: WUX302](https://reader037.vdocument.in/reader037/viewer/2022103122/56649f565503460f94c7a754/html5/thumbnails/9.jpg)
What is ASP.Net
A framework for developing and delivering information & applications on the web.Known primarily as a page framework.A complete Request/Response management system.Can handle and respond to all sorts of requests on the Internet (or an Intranet).
![Page 10: Nicholas Goossens R&D Lead Open Box Software Session Code: WUX302](https://reader037.vdocument.in/reader037/viewer/2022103122/56649f565503460f94c7a754/html5/thumbnails/10.jpg)
Characteristics of ASP.NET
Runs under its own worker process.No longer tied to IIS.Code execution managed by CLR.Code-Behind model allows code separation.Includes state handling facilities.Provides caching functionality.
![Page 11: Nicholas Goossens R&D Lead Open Box Software Session Code: WUX302](https://reader037.vdocument.in/reader037/viewer/2022103122/56649f565503460f94c7a754/html5/thumbnails/11.jpg)
Commonly Used Terms
RequestHTTP query from client to server
Response Data stream send from server to client
ASP.Net PipelineA series of extensible functionality points which continue the process of a request in order to eventually obtain a response.
Page LifecycleAnother series of functionality points that form the process of converting an ASPX page to HTML output.The entire page lifecycle occurs between two pipeline points.
![Page 12: Nicholas Goossens R&D Lead Open Box Software Session Code: WUX302](https://reader037.vdocument.in/reader037/viewer/2022103122/56649f565503460f94c7a754/html5/thumbnails/12.jpg)
Request-to-ResponseBlack Box
demo
![Page 13: Nicholas Goossens R&D Lead Open Box Software Session Code: WUX302](https://reader037.vdocument.in/reader037/viewer/2022103122/56649f565503460f94c7a754/html5/thumbnails/13.jpg)
Request-to-Response
Desktop Browser
http://www.microsoft.com/default.aspx
Black Box - Web Server (IIS)
Convert ASPX to HTML
Rendered HTML
![Page 14: Nicholas Goossens R&D Lead Open Box Software Session Code: WUX302](https://reader037.vdocument.in/reader037/viewer/2022103122/56649f565503460f94c7a754/html5/thumbnails/14.jpg)
Getting to .NET
http.sys
aspnet_isapi.dll (unmanaged)
Web Server (IIS)
Worker Process (Per App Pool)
App Domain (Per VD)
ISAPIRuntime (Managed)
http://www.asp.net/
Pipeline Kicked Off
![Page 15: Nicholas Goossens R&D Lead Open Box Software Session Code: WUX302](https://reader037.vdocument.in/reader037/viewer/2022103122/56649f565503460f94c7a754/html5/thumbnails/15.jpg)
ASP.NET Takes OverHttpRuntime.ProcessRequest
HttpContext created.This serves as an entry point into the
request, response, and other accessible variables.
An HttpApplication instance is created.
HttpApplication
Init method starts pipeline processing.
![Page 16: Nicholas Goossens R&D Lead Open Box Software Session Code: WUX302](https://reader037.vdocument.in/reader037/viewer/2022103122/56649f565503460f94c7a754/html5/thumbnails/16.jpg)
Request Initializationdemo
![Page 17: Nicholas Goossens R&D Lead Open Box Software Session Code: WUX302](https://reader037.vdocument.in/reader037/viewer/2022103122/56649f565503460f94c7a754/html5/thumbnails/17.jpg)
ASP.Net Pipeline
HttpApplication BuildStepsEvent ProcessingChecks Hooks from Global.asaxChecks hooks from HTTP Modules
URL-RewritingAuthentication - HttpContext.Current.UserCachingKick off Page Lifecycle
HttpApplication
BeginRequest
AuthenticateRequest / Post
AuthorizeRequest / Post
ResolveRequestCache / Post
MapRequestHandler / Post
AcquireRequestState / Post
PreRequestHandlerExecute / Post
ReleaseRequestState / Post
UpdateRequestCache / Post
LogRequest / Post
EndRequest
PreSendRequestHeaders
PreSendRequestContent
![Page 18: Nicholas Goossens R&D Lead Open Box Software Session Code: WUX302](https://reader037.vdocument.in/reader037/viewer/2022103122/56649f565503460f94c7a754/html5/thumbnails/18.jpg)
ASP.Net Pipelinedemo
![Page 19: Nicholas Goossens R&D Lead Open Box Software Session Code: WUX302](https://reader037.vdocument.in/reader037/viewer/2022103122/56649f565503460f94c7a754/html5/thumbnails/19.jpg)
HTTP Modules
Classes that implement IHttpModule.
MyModule : IHttpModule
![Page 20: Nicholas Goossens R&D Lead Open Box Software Session Code: WUX302](https://reader037.vdocument.in/reader037/viewer/2022103122/56649f565503460f94c7a754/html5/thumbnails/20.jpg)
ASP.NET HTTP Modules of Interest
WindowsAuthenticationModuleFormsAuthenticationModuleUrlAuthenticationModuleFileAuthorizationModuleServiceModelSessionStateModuleOutputCacheModule
![Page 21: Nicholas Goossens R&D Lead Open Box Software Session Code: WUX302](https://reader037.vdocument.in/reader037/viewer/2022103122/56649f565503460f94c7a754/html5/thumbnails/21.jpg)
ASP.Net Modulesdemo
![Page 22: Nicholas Goossens R&D Lead Open Box Software Session Code: WUX302](https://reader037.vdocument.in/reader037/viewer/2022103122/56649f565503460f94c7a754/html5/thumbnails/22.jpg)
Where the magic happensHttpApplication
BeginRequest
AuthenticateRequest / Post
AuthorizeRequest / Post
ResolveRequestCache / Post
MapRequestHandler / Post
AcquireRequestState / Post
PreRequestHandlerExecute / Post
ReleaseRequestState / Post
UpdateRequestCache / Post
LogRequest / Post
EndRequest
PreSendRequestHeaders
PreSendRequestContent
PreRequestHandlerExecute / Post
![Page 23: Nicholas Goossens R&D Lead Open Box Software Session Code: WUX302](https://reader037.vdocument.in/reader037/viewer/2022103122/56649f565503460f94c7a754/html5/thumbnails/23.jpg)
HTTP Handlers
Classes that implement IHttpHandler.
MyHandler : IHttpHandler
![Page 24: Nicholas Goossens R&D Lead Open Box Software Session Code: WUX302](https://reader037.vdocument.in/reader037/viewer/2022103122/56649f565503460f94c7a754/html5/thumbnails/24.jpg)
HTTP Handler Factories
Can also implement IHttpHandlerFactory.
MyHandlerFactory : IHttpHandlerFactory
![Page 25: Nicholas Goossens R&D Lead Open Box Software Session Code: WUX302](https://reader037.vdocument.in/reader037/viewer/2022103122/56649f565503460f94c7a754/html5/thumbnails/25.jpg)
Handler Installation
Any level in the Config chain
Handler factory that returns and executes the handler that will convert an ASPX page to HTML
output.
![Page 26: Nicholas Goossens R&D Lead Open Box Software Session Code: WUX302](https://reader037.vdocument.in/reader037/viewer/2022103122/56649f565503460f94c7a754/html5/thumbnails/26.jpg)
Handlersdemo
![Page 27: Nicholas Goossens R&D Lead Open Box Software Session Code: WUX302](https://reader037.vdocument.in/reader037/viewer/2022103122/56649f565503460f94c7a754/html5/thumbnails/27.jpg)
The PageHandlerFactory Class
Implements IHttpHandlerFactory.GetHandler method returns an IHttpHandler in the form of System.Web.UI.Page-derived class hierarchy.
Page class implements IHttpHandler.Page class inherits from Control.Control contains events/methods for the “Page Event Lifecycle”.PageHandlerFactory creates a class structure out of your request.
![Page 28: Nicholas Goossens R&D Lead Open Box Software Session Code: WUX302](https://reader037.vdocument.in/reader037/viewer/2022103122/56649f565503460f94c7a754/html5/thumbnails/28.jpg)
Anonymous ClassCreated from ASPX content
Determines language to be
used to generate page-gen class.
Specifies the partial class to
serve as the code-behind.
Optional:Name of the code-
file for Visual Studio.
![Page 29: Nicholas Goossens R&D Lead Open Box Software Session Code: WUX302](https://reader037.vdocument.in/reader037/viewer/2022103122/56649f565503460f94c7a754/html5/thumbnails/29.jpg)
Anonymous ClassCreated from ASPX content
LiteralControl
LiteralControl
LiteralControl
LiteralControl
LiteralControl
LiteralControl
Converted to instances of System.Web.UI.LiteralControl
that are added to the control tree of this class.Remember, this class will ultimately inherit from
System.Web.UI.Control
![Page 30: Nicholas Goossens R&D Lead Open Box Software Session Code: WUX302](https://reader037.vdocument.in/reader037/viewer/2022103122/56649f565503460f94c7a754/html5/thumbnails/30.jpg)
Anonymous ClassCreated from ASPX content
LiteralControl
LiteralControl
LiteralControl
LiteralControl
LiteralControl
LiteralControl
Program code directly added to generated class.
![Page 31: Nicholas Goossens R&D Lead Open Box Software Session Code: WUX302](https://reader037.vdocument.in/reader037/viewer/2022103122/56649f565503460f94c7a754/html5/thumbnails/31.jpg)
Anonymous ClassCreated from ASPX content
LiteralControl
LiteralControl
LiteralControl
LiteralControl
LiteralControl
LiteralControl
Converted to instances of the corresponding server control class for each of these control tags, that will be added to the control tree
of this class.The Form control instance is placed directly
in the control tree of the class being created; while the TextBox and Label
controls are added to the control tree of the Form control.
![Page 32: Nicholas Goossens R&D Lead Open Box Software Session Code: WUX302](https://reader037.vdocument.in/reader037/viewer/2022103122/56649f565503460f94c7a754/html5/thumbnails/32.jpg)
Anonymous ClassCreated from ASPX content
LiteralControl
LiteralControl
LiteralControl
LiteralControl
LiteralControl
LiteralControl
LiteralControl
__PAGE System.Web.UI.Page
ctrl0 System.Web.UI.LiteralControl
Function Code
ctrl1 System.Web.UI.LiteralControl
form1 System.Web.UI.HtmlControls.HtmlForm
ctrl2 System.Web.UI.LiteralControl
TextBox1 System.Web.UI.WebControls.TextBox
ctrl3 System.Web.UI.LiteralControl
Label1 System.Web.UI.WebControls.Label
ctrl4 System.Web.UI.LiteralControl
ctrl5 System.Web.UI.LiteralControl
Remember: this class “ultimately” inherits from System.Web.UI.Page
Control IDs
![Page 33: Nicholas Goossens R&D Lead Open Box Software Session Code: WUX302](https://reader037.vdocument.in/reader037/viewer/2022103122/56649f565503460f94c7a754/html5/thumbnails/33.jpg)
Anonymous ClassCreated from ASPX content
LiteralControl
LiteralControl
LiteralControl
LiteralControl
LiteralControl
LiteralControl
LiteralControl
![Page 34: Nicholas Goossens R&D Lead Open Box Software Session Code: WUX302](https://reader037.vdocument.in/reader037/viewer/2022103122/56649f565503460f94c7a754/html5/thumbnails/34.jpg)
Page Class Generation
![Page 35: Nicholas Goossens R&D Lead Open Box Software Session Code: WUX302](https://reader037.vdocument.in/reader037/viewer/2022103122/56649f565503460f94c7a754/html5/thumbnails/35.jpg)
Anonymous Class Creationdemo
![Page 36: Nicholas Goossens R&D Lead Open Box Software Session Code: WUX302](https://reader037.vdocument.in/reader037/viewer/2022103122/56649f565503460f94c7a754/html5/thumbnails/36.jpg)
Page (Control) LifecyclePreInitInitInitCompleteCreateChildControls (IsPostBack)LoadViewState/LoadControlStateIPostBackDataHandler.LoadPostDataPreLoadLoadIPostBackDataHandler.RaisePostBackChangedEventIPostBackEventHandler.RaisePostBackEventLoadCompleteCreateChildControls (!IsPostBack)PreRenderDataBindPreRenderCompleteSaveViewState/SaveControlStateRenderUnload
Complete List
![Page 37: Nicholas Goossens R&D Lead Open Box Software Session Code: WUX302](https://reader037.vdocument.in/reader037/viewer/2022103122/56649f565503460f94c7a754/html5/thumbnails/37.jpg)
Control Rendering
Activated through the Control class’ Render method.Each control is designed to output something to the response buffer.Most controls output HTML.Some controls contain others in their tree.Control rendering involves recursively rendering child controls.Controls don’t need to output anything
ScriptManager
![Page 38: Nicholas Goossens R&D Lead Open Box Software Session Code: WUX302](https://reader037.vdocument.in/reader037/viewer/2022103122/56649f565503460f94c7a754/html5/thumbnails/38.jpg)
Getting a Response
“Rendering” uses an HtmlTextWriter stored in the Response object.Response object is part of HttpContext.Writer sent into Render method.After pipeline complete, contents returned up the chain to aspnet_isapi.dll then http.sys.Results viewed on browser.
![Page 39: Nicholas Goossens R&D Lead Open Box Software Session Code: WUX302](https://reader037.vdocument.in/reader037/viewer/2022103122/56649f565503460f94c7a754/html5/thumbnails/39.jpg)
Extras
PostbacksASCX User ControlsMaster PagesASHX HandlersThemes & SkinsAJAXMVC
![Page 40: Nicholas Goossens R&D Lead Open Box Software Session Code: WUX302](https://reader037.vdocument.in/reader037/viewer/2022103122/56649f565503460f94c7a754/html5/thumbnails/40.jpg)
Process Summary
IIS
Worker Process
Pipeline (Modules)
Lifecycle (Handlers)
Render (Response)
![Page 41: Nicholas Goossens R&D Lead Open Box Software Session Code: WUX302](https://reader037.vdocument.in/reader037/viewer/2022103122/56649f565503460f94c7a754/html5/thumbnails/41.jpg)
What To Take Away From This
ASP.NET does much more than serve pagesDecoupled architecture allows flexible hostingPipeline and Page Life cycle – two different thingsExtensible architecture allows opportunities for interception and alterationModule and Handler do the workBe mindful of how much is happening behind the scenes
![Page 42: Nicholas Goossens R&D Lead Open Box Software Session Code: WUX302](https://reader037.vdocument.in/reader037/viewer/2022103122/56649f565503460f94c7a754/html5/thumbnails/42.jpg)
Resources
How ASP.NET Workshttp://www.west-wind.com/presentations/howaspnetworks/howaspnetworks.asp
ASP.NET Page Class Overviewhttp://msdn.microsoft.com/en-us/library/ms178138.aspx
IIS and the Process Modelhttp://dotnetslackers.com/articles/iis/ASPNETInternalsIISAndTheProcessModel.aspx
![Page 43: Nicholas Goossens R&D Lead Open Box Software Session Code: WUX302](https://reader037.vdocument.in/reader037/viewer/2022103122/56649f565503460f94c7a754/html5/thumbnails/43.jpg)
question & answer
![Page 44: Nicholas Goossens R&D Lead Open Box Software Session Code: WUX302](https://reader037.vdocument.in/reader037/viewer/2022103122/56649f565503460f94c7a754/html5/thumbnails/44.jpg)
www.microsoft.com/teched
International Content & Community
http://microsoft.com/technet
Resources for IT Professionals
http://microsoft.com/msdn
Resources for Developers
www.microsoft.com/learning
Microsoft Certification & Training Resources
Resources Tech·Ed Africa 2009 sessions will be made available for download the week after the event from: www.tech-ed.co.za
![Page 45: Nicholas Goossens R&D Lead Open Box Software Session Code: WUX302](https://reader037.vdocument.in/reader037/viewer/2022103122/56649f565503460f94c7a754/html5/thumbnails/45.jpg)
Related Content
WUX306 - Taking AJAX to the Next Level
WUX07-HOL - Diagnosing and Troubleshooting Web Applications in Internet Information Services (IIS) 7.0
AZP04-HOL - Building Windows Azure ServicesDAT01-HOL - Application Development for Microsoft SQL Server 2008: Let's Write Some Code!
![Page 46: Nicholas Goossens R&D Lead Open Box Software Session Code: WUX302](https://reader037.vdocument.in/reader037/viewer/2022103122/56649f565503460f94c7a754/html5/thumbnails/46.jpg)
Complete a session evaluation and enter to win!
10 pairs of MP3 sunglasses to be won
![Page 47: Nicholas Goossens R&D Lead Open Box Software Session Code: WUX302](https://reader037.vdocument.in/reader037/viewer/2022103122/56649f565503460f94c7a754/html5/thumbnails/47.jpg)
© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS,
IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.