Nicholas Goossens R&D Lead Open Box Software Session Code: WUX302.

Slides:



Advertisements
Similar presentations
Shyam Pather Development Manager Microsoft Session Code: DTL402.
Advertisements

Anatomy of an ASP.NET Page. Slide 2 My Version of the Big Picture (1) ASP Worker (Engine) Your application Runs Server Other applications User 1User 2.
Web Platform Introduction With a focus on “free” Mike Taulty Developer & Platform Group Microsoft Ltd
 Mark Friedman Architect Developer Division Microsoft Corporation.
Louis de Klerk Consultant Inobits Consulting DTL308.
Saad Ladki Program Manager Microsoft Corporation WUX403.
 Bertrand Le Roy Senior Program Manager Lead Microsoft Corporation PC32.
Bhushan NeneGrzegorz Gogolowicz Principal ArchitectSenior ArchitectMicrosoft Session Code: DEV304.
Chris Menegay VP of Consulting Notion Solutions, Inc. DTL319.
Tony Whitter Principal, Whitter Technology WMB401 Author Jeff Neafsey Mobility Architect Microsoft.
J. Michael Palermo IV Director of Development Interface, USA WUX203.
Siddharth Bhatia Senior Program Manager Microsoft Session Code: DTL301.
Nik Kalyani Co-founder DotNetNuke Corporation WUX312.
Eric Carter Development Manager Microsoft Corporation OFC324.
Tim Keller Lead Developer Umoya Networks DTL302 Who am I Tim Keller or timk.co.za) Your typical Mac/Linux type Lead Developer of a PHP-based.
Thavash Govender Senior BI Consultant iSolve Business Solutions BIN307.
Donald Farmer Microsoft Corporation BIN308.
Pieter Hancke Senior Consultant Microsoft Consulting Services Session Code: WCL303.
Gail Shaw XpertEase DAT 305 Topics Background Information Query Hints Plan Cache Metadata Plan Guides Plan Freezing Monitoring Plan Guide Use.
Arend-Jan Speksnijder Solutions Architect Microsoft Dynamics Lighthouse team Dynamics AX2009 Technical Overview and Demo (DYN301)
Gavin Russell-Rockliff BI Technical Specialist Microsoft BIN202.
05 | Integrating JavaScript and MVC 4 Jon Galloway | Tech Evangelist Christopher Harrison | Head Geek.
1 ASP.NET Internals
Tim Rains Group Product Manager Microsoft Session Code: SIA101.
Sara Ford Program Manager Microsoft Corporation DPR301.
Warren Stevens-Baytopp Director YoungBlood Consultants Session Code BIN303.
J. Michael Palermo IV Director of Development Interface, USA WUX206.
OFC308 Hilton Giesenow Development Manager - 3fifteen Host –
Luke Hoban Senior Program Manager Microsoft Session Code: DTL319.
Mark Michaelis Chief Computer Nerd IDesign/Itron/IntelliTechture DTL313.
Scott Morrison Program Manager Microsoft Corporation Session Code: WUX308.
Errol Schoenfish Director Product Management Microsoft Session Code: DYN304.
ASP.NET Architecture Mike Taulty Developer & Platform Group Microsoft Ltd
DEV410 Inside the ASP.NET Runtime - Intercepting HTTP Requests Michele Leroux Bustamante Principal Software Architect IDesign Inc.
OFC303 Hilton Giesenow Development Manager - 3fifteen Host –
6/2/2018 3:37 PM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
6/13/2018 1:23 AM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
6/23/2018 8:42 AM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
6/26/2018 9:02 PM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Microsoft Ajax Taking Ajax to the Next Level
9/11/2018 5:53 PM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Tech·Ed North America /14/2018 7:13 PM
Tech·Ed North America /15/2018 3:31 AM
TechEd /14/2018 6:26 PM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered.
Sysinternals Tutorials
11/22/2018 8:05 PM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Anatomy of an ASP.NET Page
Understanding ASP.NET Under The Covers
12/5/2018 3:24 PM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Tiberiu Covaci Senior Technical Trainer Many-core
12/27/ :01 PM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Authoring for Microsoft Silverlight 4 with Microsoft Expression Blend
Data Driven ASP.NET Web Forms Applications Deep Dive
Tech Ed North America /1/2019 2:58 AM Required Slide
Tech·Ed North America /2/2019 4:47 PM
ASP.NET 4.0 State Management Improvements – Deep Dive
Tech·Ed North America /17/2019 1:47 AM
2/16/2019 8:43 AM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
2/17/2019 7:32 AM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Peter Provost Sr. Program Manager Microsoft Session Code: DEV312
Building Silverlight Apps with RIA Services
Tech Ed North America /12/2019 6:45 AM Required Slide
SharePoint 2013 Authentication with Azure – Part 1
2010 Microsoft BI Conference
Tech·Ed North America /25/ :53 PM
Hack-proofing your Clients using Windows 7 Security!
Code First Development in Microsoft ADO.NET Entity Framework 4.1
SharePoint 2013 Authentication with Azure – Part 2
5/24/ :22 AM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
6/20/2019 1:09 AM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Presentation transcript:

Nicholas Goossens R&D Lead Open Box Software Session Code: WUX302

How does it work?

Classic ASP ASP.Net Authentication Page Lifecycle AJAX Controls.aspx.ashx Handlers User Controls Custom Controls Browser Targeting Doc Types Services Master Pages Client Script Request Response Parsing

Agenda ASP from Then till Now Buzzwords Request-to-Response Walkthrough ASP.Net Extras Summary

Classic ASP Interpreted language Included embedded scripting code mixed into HTML Limited to VBScript Ran in the same process as IIS Inherently not scalable (needed MTS)

ASP.Net Beginnings Designed by Scott Guthrie & Mark Anders Originally known as XSP Not.NET-related – Java based ! Became ASP+ with the design of the CLR Rewritten in C# Renamed when.NET branding introduced

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).

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.

Commonly Used Terms Request HTTP query from client to server Response Data stream send from server to client ASP.Net Pipeline A series of extensible functionality points which continue the process of a request in order to eventually obtain a response. Page Lifecycle Another 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.

Request-to-Response Black Box

Request-to-Response Desktop Browser Black Box - Web Server (IIS) Rendered HTML

Getting to.NET http.syshttp.sys aspnet_isapi.dll (unmanaged) Web Server (IIS) Worker Process (Per App Pool) App Domain (Per VD) ISAPIRuntime (Managed) Pipeline Kicked Off

ASP.NET Takes Over HttpRuntime.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.

Request Initialization

ASP.Net Pipeline HttpApplication BuildSteps Event Processing Checks Hooks from Global.asax Checks hooks from HTTP Modules URL-Rewriting Authentication - HttpContext.Current.User Caching Kick 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

ASP.Net Pipeline

HTTP Modules Classes that implement IHttpModule. MyModule : IHttpModule

ASP.NET HTTP Modules of Interest WindowsAuthenticationModule FormsAuthenticationModule UrlAuthenticationModule FileAuthorizationModule ServiceModel SessionStateModule OutputCacheModule

ASP.Net Modules

Where the magic happens HttpApplication BeginRequest AuthenticateRequest / Post AuthorizeRequest / Post ResolveRequestCache / Post MapRequestHandler / Post AcquireRequestState / Post PreRequestHandlerExecute / Post ReleaseRequestState / Post UpdateRequestCache / Post LogRequest / Post EndRequest PreSendRequestHeaders PreSendRequestContent PreRequestHandlerExecute / Post

HTTP Handlers Classes that implement IHttpHandler. MyHandler : IHttpHandler

HTTP Handler Factories Can also implement IHttpHandlerFactory. MyHandlerFactory : IHttpHandlerFactory

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.

Handlers

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.

Anonymous Class Created 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.

Anonymous Class Created from ASPX content 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

Anonymous Class Created from ASPX content LiteralControl Program code directly added to generated class.

Anonymous Class Created from ASPX content 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.

Anonymous Class Created from ASPX content 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

Anonymous Class Created from ASPX content LiteralControl

Page Class Generation

Anonymous Class Creation

Page (Control) Lifecycle PreInit Init InitComplete CreateChildControls (IsPostBack) LoadViewState/LoadControlState IPostBackDataHandler.LoadPostData PreLoad Load IPostBackDataHandler.RaisePostBackChangedEvent IPostBackEventHandler.RaisePostBackEvent LoadComplete CreateChildControls (!IsPostBack) PreRender DataBind PreRenderComplete SaveViewState/SaveControlState Render Unload Complete List

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

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.

Extras Postbacks ASCX User Controls Master Pages ASHX Handlers Themes & Skins AJAX MVC

Process Summary IISIIS Worker Process Pipeline (Modules) Lifecycle (Handlers) Render (Response)

What To Take Away From This ASP.NET does much more than serve pages Decoupled architecture allows flexible hosting Pipeline and Page Life cycle – two different things Extensible architecture allows opportunities for interception and alteration Module and Handler do the work Be mindful of how much is happening behind the scenes

Resources How ASP.NET Works wind.com/presentations/howaspnetworks/howasp networks.asp ASP.NET Page Class Overview us/library/ms aspx IIS and the Process Model nalsIISAndTheProcessModel.aspx

International Content & Community Resources for IT Professionals Resources for Developers Microsoft Certification & Training Resources Resources Required Slide Speakers, TechEd 2009 is not producing a DVD. Please announce that attendees can access session recordings from Tech-Ed website. These will only be available after the event. Required Slide Speakers, TechEd 2009 is not producing a DVD. Please announce that attendees can access session recordings from Tech-Ed website. These will only be available after the event. Tech ·Ed Africa 2009 sessions will be made available for download the week after the event from:

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 Services DAT01-HOL - Application Development for Microsoft SQL Server 2008: Let's Write Some Code! Required Slide Speakers, please list the Breakout Sessions, TLC Interactive Theaters and Labs that are related to your session. Any queries, please check with your Track Owner. Required Slide Speakers, please list the Breakout Sessions, TLC Interactive Theaters and Labs that are related to your session. Any queries, please check with your Track Owner.

Required Slide Complete a session evaluation and enter to win! 10 pairs of MP3 sunglasses to be won

© 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. Required Slide