WEB322 ASP.NET Internals: Under the Covers – Exploring Internals, Page Lifecycle and the Compilation Model Simon Calvert Program Manager Web Platform and.

Slides:



Advertisements
Similar presentations
Malek Kemmou Technology Architect, Application Platform Microsoft Middle East and Africa Overview of ASP.NET 2.0.
Advertisements

Unit 02. ASP.NET Introduction HTML & Server controls Postbacks Page Lifecycle.
DEV392: Extending SharePoint Products And Technologies Through Web Parts And ASP.NET Clint Covington, Program Manager Data And Developer Services - Office.
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 Development Using ASP.NET CA – 240 Kashif Jalal Welcome to week – 1.1 of…
Web Platform Introduction With a focus on “free” Mike Taulty Developer & Platform Group Microsoft Ltd
IIS 7: The Next Generation Web Application Server Platform Michael Volodarsky Program Manager Web Platform and Tools Team Microsoft Corporation.
Best Practices for UI with ASP.NET 2.0 Jeff King Program Manager Web Platform and Tools Microsoft Corporation.
 Visual Studio has great support for building ASP.NET web applications  Real web application development involves more than just copying the files created.
Building Scalable and Reliable Web Applications Vineet Gupta Technology Evangelist Microsoft Corporation
Creating Multi-lingual Applications and Websites with Microsoft Visual Studio 2005 Achim Ruopp International Program Manager Microsoft Corporation.
Punit Shah Technical Lead | Microsoft
Web Forms. Agenda Web forms Web controls Code separation Dynamic compilation System.Web.UI.Page User controls.
Joe Hummel, PhD Dept of Mathematics and Computer Science Lake Forest College Lecture 8: WebForms — Web-based.
WEB329 ASP.NET: A Lap Around the New Enhancements for Web Developers in Microsoft Visual Studio 2005 Omar Khan Lead Program Manager Web Platform and Tools.
ASP.Net, Web Forms and Web Controls 1 Outline Introduction Simple HTTP Transaction System Architecture Creating and Running a Simple Web Form Example Web.
Preview of ASP.NET 2.0 in Delphi Course #3182 Jim Tierney Principal Engineer - Borland.
Tutorial: Introduction to ASP.NET Internet Technologies and Web Application 4 th February 2010.
© 2004 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill/Irwin Programming the Web Using ASP.Net Chapter 2: The ASP.Net Template Dave.
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.
Deployment of web Site. Preparing the web site for deployment you now have two versions of web site 1 -one running in the production environment 2-one.
Ch6:creating consistent looking web sites. Master pages Master page defines a combination of fixed content and content place holder to hold the web page(.aspx)
1 ASP.NET. 2 ASP.NET Architecture ASP.NET uses the CLR to replace the existing ISAPI/ASP infrastructure of IIS with a more efficient and easier-to-use.
ASP.NET + Ajax Jesper Tørresø ITNET2 F08. Ajax Ajax (Asynchronous JavaScript and XML) A group of interrelated web development techniques used for creating.
February 16, Aaron Cuffman Andy Nagle Adam Schultz Web Site.
Beginning Web Site Development Module 1 – Dynamic Web Site Development Fundamentals of building dynamic Web sites with ASP.NET 2.0 and C# Version.
INSPIRING CREATIVE AND INNOVATIVE MINDS Module 4: Adding Code to a Microsoft ASP.NET Web Form Implementing Code-Behind Pages Adding Event Procedures to.
Introduction to ASP.NET 1www.tech.findforinfo.com.
11 Web Services. 22 Objectives You will be able to Say what a web service is. Write and deploy a simple web service. Test a simple web service. Write.
ASP.NET application. Roadmap ASP.NET file types Bin directory Application updates Simple application from start to finish using a virtual directory Behind.
Murach’s ASP.NET 4.0/VB, C1© 2006, Mike Murach & Associates, Inc.Slide 1.
Cross-Language Demo Demonstrates mixing C# and VB.NET code C# Class CSDemoClass.cs VB.NET Class VBDemoClass.vb “Main” class (C#) Demo.cs.
COMP3241 E-Business Technologies Richard Henson University of Worcester October 2012.
Connect with life Sundararajan Subramanian SDE | Microsoft R&D India Pvt Ltd.,
Overview of Previous Lesson(s) Over View  SDI programs  The Application Wizard can generate single-document interface (SDI) applications that work.
Introducing ASP.NET 2.0. Internet Technologies WWW Architecture Web Server Client Server Request Response Network HTTP TCP/IP PC/Mac/Unix + Browser (IE,
Anatomy of an ASP.NET Page. Slide 2 Compiling an ASP.NET Page An ASP.NET page is compiled when it is rendered for the first time A page is compiled to.
XML Web Service. Overview of XML Web Service ASP.NET XML Web services enable you to remotely access the properties and methods of classes across a network.
WEB320 Migrating ASP.NET 1.x Applications to ASP.NET 2.0 Stefan Schackow Program Manager Web Platform and Tools Team Microsoft Corporation.
WEB428 ASP.NET 2.0: Advanced Server Controls and Web Parts with ASP.NET 2.0 Andres Sanabria Program Manager Web Platform and Tools Team Microsoft Corporation.
Beginning ASP.NET (Part 3).NET 2.0 Core Libraries Tuc Goodwin.
DEV303 ASP.NET: Leveraging Visual Studio.NET For Web Projects Tony Goodhew Product Manager Microsoft Corp.
PAGE DIRECTIVES. Page Directives  They are instructions, inserted at the top of an ASP.NET page, to control the behavior of ASP.NET pages.  So it is.
Christopher M. Pascucci.NET Programming CodeBehind.
ASP.NET (Active Server Page) SNU OOPSLA Lab. October 2005.
Connect with life Vedant Kulshreshtha Technology Solutions Professional – SharePoint | Microsoft India
Understanding Web Applications Lesson 4. Objective Domain Matrix Skills/ConceptsMTA Exam Objectives Understanding Web Page Development Understand Web.
Web Application Development Introduction. Lesson: Creating Web Forms What is a Web Form? Creating a Web Form with Visual Studio.NET.
DEV395 No Touch Deployment for Windows Forms Jamie Cool Program Manager.NET Client Microsoft Corporation.
Migrating from ASP.NET 1.1 to ASP.NET 2.0 Scott Guthrie Web Platform and Tools Team Microsoft Corporation
Svetlin Nakov Telerik Corporation
Building Custom Controls with ASP.NET and the Microsoft ®.NET Framework Rames Gantanant Microsoft Regional Director, Thailand
11 User Controls Beginning ASP.NET in C# and VB Chapter 8.
1 ASP.NET Internals
Migrating from ASP.NET 1.1 to ASP.NET 2.0 Scott Guthrie Web Platform and Tools Team Microsoft Corporation
Introduction to ASP.NET development. Background ASP released in 1996 ASP supported for a minimum 10 years from Windows 8 release ASP.Net 1.0 released.
Name Title Microsoft Corporation
ASP.NET Architecture Mike Taulty Developer & Platform Group Microsoft Ltd
ASP.NET 2.0 Mohammed Abdelhadi Developer.NET Evangelist Microsoft Corporation.
Creating Consistent Looking Websites
Building rich web applications with ASP.NET AJAX Mike Ormond Developer & Platform Evangelism Group, Microsoft Ltd Developer & Platform Evangelism Group,
ASP.NET AJAX – Basics Svetlin Nakov Telerik Corporation
ASP.NET Web Forms and Web Services
Application Infrastructure
ASP.NEXT The ASP.NET 3.5 Extensions
Anatomy of an ASP.NET Page
From Development to Production: Optimizing for Continuous Delivery
ASP.NET Imran Rashid CTO at ManiWeber Technologies.
ASP.NET 2.0 Overview Created By: Ajay Bahoriya.
Introduction to ASP.NET Parts 1 & 2
Presentation transcript:

WEB322 ASP.NET Internals: Under the Covers – Exploring Internals, Page Lifecycle and the Compilation Model Simon Calvert Program Manager Web Platform and Tools Team Microsoft Corporation

Agenda ASP.NET compilation Development cycles and options: Dynamic compilation Pre-compilation Build extensibility ASP.NET page lifecycle Call backs, cross-page post Asynchronous pages

ASP.NET V2 Web Application

Design-time: VS Pages: Code-behind Control: Code ‘spit’ Objects: \bin (own dll) Build: (App.DLL) ASP.NET v1.x Development Cycles Design & Develop ASPX … CS/VBApp.DLL Deploy Test/Production ASPX … CS/VBApp.DLL Deploy Test/ Production ASPX … (CS/VB)App.DLL Layout (xcopy, copy web, build) ASPX … : Allows changes Code: Can remove. Changes rebuild App.DLL App.DLL: Pre-built or build Runtime: ASP.NET Dynamic compilation of known ‘file’ types Knows ‘single-file’ only

System.Web.UI.Page ASP.NET v1.x Compilation Page Compilation Class defined in codebehind App1.WF.. Class defined in codebehind App1.WF1 VS Build (pre-compile) Auto- generated page class ASP.MyClass2 Auto- generated page class ASP.MyClass Dynamic compile Page codebehind=“wf1.aspx.cs” inherits=“App1.WF1” classname=“MyClass” File containing separated code. Designer only. Class that the page-gen’ inherits from An (optional) class-name for the page-gen’ class namespace App1 { public class WF1 : System.Web.UI.Page {.. } } Base class. Final base is System.Web.UI.Page Code behind class. Namespace driven by project and folder (C#).

Layout: (xcopy, build..) Dynamic compilation: Pre-compilation: W/o source and/or markup (allows changes) Deploy Test/ Production ASPX … WSDL, XSD, RESX CS/VBDLL Deploy Test/ Production ASPX … DLL Deploy Test/ ProductionDLL Design-time: VS Pages: Code-behind or single file Control: No code ‘spit’ ASP.NET v2 Development Cycles Design & Develop ASPX … WSDL, XSD, RESX CS/VBDLL Runtime: ASP.NET Dynamic compilation of file ‘types’, (extensible) Compilation of specialized folders

Auto- generated partial class Default2 Partial class defined in codefile Default2 Auto- generated page class MyClass2 Auto- generated page class MyClass Auto- generated partial class _Default Partial class defined in codefile _DefaultSystem.Web.UI.Page Dynamic compile ASP.NET v2 Compilation Page Compilation Page codefile=“default.aspx.cs” inherits=“_Default” classname=“MyClass ” File containing separated code Class that the page-gen inherits from An (optional) class-name for the page-gen class public partial class _Default : System.Web.UI.Page Class is ‘partial’. Combined to auto-gen’ partial class Base Class. Final base is System.Web.UI.Page

ASP.NET v2 Code-Behind and Compilation

ASP.NET v2 Compilation Specialized Folders \WeatherForecastApp \App_Code \App_Code global.ASAX global.ASAX Extends HttpApplication 1.Application events Bus’ Logic, Base & Utility Classes.. Compile assembly (or many in order in ) 1.Single language per folder 2.Can contain ‘non-code’ types \App_GlobalResources \App_GlobalResources Global Resources 1.Strongly-typed resources 2.Shared in application \App_WebReferences \App_WebReferences Web Service References 1.Folder structure defines type 2.Dynamic URL proxy generation 3.Consumable throughout application \App_Browsers \App_Browsers Browser Capabilities 1..BROWSER files 2.Compiled on demand default.aspx default.aspx \App_LocalResources \App_LocalResources \App_Themes\Theme \App_Themes\Theme Page compilation 1.Compiled on demand 2.Batching and dependencies 3.Local resources compiled 4.Theme and master-pages compiled on demand

ASP.NET v2 Pre-compilation Scenarios No ‘penalty’ for first-time request: In-place pre-compilation Deploy to a server: No ‘code’ or markup on the server Allow markup for minor changes, UI layout Ship to a third party, IP restriction: Package deployed application

Pre-compilation

Auto- generated partial Default2 Partial class defined in codefile Default2 Auto- generated partial ‘stub’ HomePage Partial class defined in codefile HomePageSystem.Web.UI.Page Page codefile=“home.aspx.cs” inherits=“HomePage” classname=“MyPage” public partial class HomePage : System.Web.UI.Page Pre-compile Auto- generated page class MyPage2 Auto- generated page class MyPage ASP.NET v2 Pre-compilation Page Allows Updates Page inherits=“HomePage, App_Web_#####” classname=“MyPage” Dynamic compile Page codefile=“home.aspx.cs” inherits=“HomePage” classname=“MyPage”

ASP.NET v2 Build Extensibility Scenarios File-based type extensibility: Create custom types from arbitrary file types, e.g. XSD in \App_Code Create custom handlers, e.g. ASHX Create custom content, e.g. ASCX Non-file based source extensibility: Move web content to a database

Custom BuildProvider and VirtualPathProvider

ASP.NET v2 Page Framework Page Lifecycle Methods, events, auto-hookups (Page_): OnPreInit: Dynamic MasterPageFile, Theme OnPreLoad, OnLoadComplete.. InitializeCulture: Dynamic Culture/UICulture code-gen call when attributes defined Partial page lifecycle: Cross-page posts, control call backs.. Asynchronous page

ASP.NET v2 Page Framework Callback Lifecycle C Control Developer Scenario GET C-BK Initialize Load State Load Pre-render Save State Render Unload Raise Callback Event: RaiseCallbackEvent

ASP.NET v2 Page Framework Cross-page Post public String TextBoxText { get { return TB.Text; } }.... =============================================================== protected void Page_Load(object sender, eventArgs e) { if (MyLabel.Text = PreviousPage.TextBoxText; }

ASP.NET v2 Page Framework Cross-page Post Lifecycle P Page Developer Scenario GET PrevPage Initialize Load State and Post Data Load Pre-render Save State Render Unload Raise Changed Events and Postback Event

ASP.NET v2 Page Framework Asynchronous Page Model 3-tier web applications: Synchronous pages (v1.x, v2): Remote resource (web service, database) is unresponsive threads are blocked Web application may be unresponsive Asynchronous pages (v2): Create non-blocking call to access remote resources Isolates issue to pages accessing remote resources Potential to reduce # threads, improve latency and throughput

ASP.NET v2 Page Framework Asynchronous Page Model V1.x: Pages make sync (blocking) Web Service calls Can use IHttpAsyncHandler(not a page) Can use IHttpAsyncHandler (not a page) V2: New ‘event’ style async pattern Simplifies making async calls V2: Pages can be async: ‘Event’ or BeginXXXX/EndXXXX styles

ASP.NET v2 Page Framework Asynchronous Page Model private String wsResult; protected void Page_Load(Object s, EventArgs e) { WS ws = new WS(); ws.MethodCompleted += new MethodCompletedEventHandler(this.MyHandler); ws.MethodAsync(); } void MyHandler(Object s, MethodCompletedEventArgs e) { wsResult = e.Result; }..

ASP.NET v2 Page Framework Async Page Lifecycle P Page Developer Scenario GET/POST Initialize Load State and Post Data Load Pre-render Save State Render Unload Async Point: Suspension of lifecycle Raise Changed Events and Postback Event OnPreRenderComplete

Call to Action and Summary ScenarioOptions Design, develop and deploy No pre-build required Dynamic compilation Deploy and omit 1 st request penalty Pre-compilation (in-place) Deploy no source code Pre-compilation (allow markup changes) and dynamic compilation Deploy no source code or markup Pre-compilation (no code or markup changes) Deploy and release management Pre-compilation options for fixednames, keyfile..

Resources WEB320 ASP.NET Best Practices and Techniques for Migrating ASP.NET 1.x Applications to ASP.NET 2.0 WEB323/324 Overview of ASP.NET 2.0 (Part 1) and (Part2) WEBC11 Q&A ASYNC, Compilation and other 500+ Level Topics With the Web Platform Development Team

Your Feedback is Important! Please Fill Out a Survey for This Session on CommNet

© 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.