Application Infrastructure

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.
Web Development in Microsoft Visual Studio Slide 2 Lecture Overview Introduce Visual Studio 2013 Create a first ASP.NET application.
Web Platform Introduction With a focus on “free” Mike Taulty Developer & Platform Group Microsoft Ltd
ASP.NET 2.0 Chapter 6 Securing the ASP.NET Application.
Building Applications using ASP.NET and C# / Session 14 / 1 of 18 Session 14.
Creating Multi-lingual Applications and Websites with Microsoft Visual Studio 2005 Achim Ruopp International Program Manager Microsoft Corporation.
IT533 Lectures Configuring, Deploying, Tracing and Error Handling.
IIS, Tools And Extensibility Madhur Joshi Development Lead Phone:
ASP.Net, Web Forms and Web Controls 1 Outline Introduction Simple HTTP Transaction System Architecture Creating and Running a Simple Web Form Example Web.
Marco Bellinaso Senior Trainer & Consultant Code Architects Srl Web: Administration.
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.
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.

An Introduction to ASP.NET Ed Dunhill blogs.msdn.com/edunhill SLIDE7.
Overview of Previous Lesson(s) Over View  Server controls are small building blocks of the graphical user interface, which includes  Text boxes  Buttons.
Beginning Web Site Development Module 1 – Dynamic Web Site Development Fundamentals of building dynamic Web sites with ASP.NET 2.0 and C# Version.
Session 10: Managing State. Overview State Management Types of State Management Server-Side State Management Client-Side State Management The Global.asax.
Introduction to ASP.NET 1www.tech.findforinfo.com.
Internet Information Server © N. Ganesan, Ph.D. All Rights Reserved.
ASP.NET application. Roadmap ASP.NET file types Bin directory Application updates Simple application from start to finish using a virtual directory Behind.
The Web Architecture and ASP.NET. Slide 2 Review of the Web (1) It began with HTTP and HTML, which delivers static Web pages to browsers which would render.
DEV325 Deploying Visual Studio.NET Applications Billy Hollis Author / Consultant.
DEV339 Best Practices for Debugging Visual Studio.NET Applications Keith Pleas Architect, Guided Design
10 – 12 APRIL 2005 Riyadh, Saudi Arabia. Building multi-lingual ASP.Net application that handle western languages and Arabic with a single code base.
1 CS 3870/CS 5870 Note04 Session Variables and Post Back.
Efficient Deployment & Management of ASP.NET 2.0 Applications on IIS 6.0 Alexis Eller Program Manager Internet Information Services Microsoft Corporation.
Introducing ASP.NET 2.0. Internet Technologies WWW Architecture Web Server Client Server Request Response Network HTTP TCP/IP PC/Mac/Unix + Browser (IE,
1 CS 3870/CS 5870: Note 07 Lab 3 Lab 4 Test 1: Two Tables.
Slide 1 ASP Authentication There are basically three authentication modes Windows Passport Forms There are others through WCF You choose an authentication.
Module 7: Creating a Microsoft ASP.NET Web Application.
Module 2: Using Microsoft Visual Studio.NET. Overview Overview of Visual Studio.NET Creating an ASP.NET Web Application Project.
WEB320 Migrating ASP.NET 1.x Applications to ASP.NET 2.0 Stefan Schackow Program Manager Web Platform and Tools Team Microsoft Corporation.
VITALE, CATURANO & COMPANY LTD Microsoft SharePoint Web Part Development Overview VITALE, CATURANO & COMPANY LTD SharePoint Developer Series – Web Part.
DEV303 ASP.NET: Leveraging Visual Studio.NET For Web Projects Tony Goodhew Product Manager Microsoft Corp.
Web Services Error Handling and Debugging. Agenda Simple SOAP faults Advanced SOAP faults SOAP headers and faults Error handling From a Service Perspective.
Web Application Development Introduction. Lesson: Creating Web Forms What is a Web Form? Creating a Web Form with Visual Studio.NET.
ASP. NET Differences Dave Webster EMEA Technical Team dave
ASP.NET P AGE O BJECTS.  Each ASP.NET page inherits the PAGE object  The PAGE supplies 3 built in objects:  REQUEST: All information passed to the.
Migrating from ASP.NET 1.1 to ASP.NET 2.0 Scott Guthrie Web Platform and Tools Team Microsoft Corporation
WEB322 ASP.NET Internals: Under the Covers – Exploring Internals, Page Lifecycle and the Compilation Model Simon Calvert Program Manager Web Platform and.
Configuring and Deploying Web Applications Lesson 7.
11 Getting Started with ASP.NET Beginning ASP.NET in C# and VB Chapters 1 and 2.
IIS Manager Details Delegated Administration Configuration System.
Copyright © 2006 Pilothouse Consulting Inc. All rights reserved. Web Parts Overview Web parts in SharePoint 2007 “Hello World” web part Typical deployment.
Svetlin Nakov Telerik 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.
Alexey Polovinkin Post graduate student, CMC department.
Introduction to ASP.NET, Second Edition2 Chapter Objectives.
Vinod Unny Enterprise InfoTech Microsoft Regional Director, North India
ASP.NET 2.0 Mohammed Abdelhadi Developer.NET Evangelist Microsoft Corporation.
Computing with C# and the .NET Framework
ASP.NET Forms.
Agenda Introduction Security flow for a request Authentication
Efficient Deployment & Management of ASP. NET 2
Introduction to ASP.NET 2.0
ITEC 420 Framework Based Internet Applications
Session Variables and Post Back
Globalization support in ASP.NET
6/11/2018 8:14 AM THR2175 Building and deploying existing ASP.NET applications using VSTS and Docker on Windows Marcel de Vries CTO, Xpirit © Microsoft.
ASP.NET Web Configuration File
ASP.NET Application Framework
Web Development in Microsoft Visual Studio 2013
ASP.NET 2.0 Overview Created By: Ajay Bahoriya.
Introduction to ASP.NET Parts 1 & 2
Mark Quirk Head of Technology Developer & Platform Group
ITEC 420 Framework Based Internet Applications
MS Confidential : SharePoint 2010 Developer Workshop (Beta1)
Presentation transcript:

Application Infrastructure Programming ASP.NET Application Infrastructure Copyright © 2001-2002

Agenda Web.config Global.asax Components and the Code directory Resources and the Resources directory

Web.config XML file containing configuration directives Configuration is file-based, not registry-based Organized into hierarchical config sections Private to individual applications Maximum of one per directory Configuration inheritance propagates settings down through directory hierarchy Backed by full read/write API

Inside Web.config Configuration sections <system.web> <?xml version="1.0"?> <configuration> <connectionStrings> <add name="Northwind" connectionString="..." /> </connectionStrings> <system.web> <authentication mode="Forms"/> <membership defaultProvider="AspNetSqlProvider"/> <roleManager enabled="true" <profile defaultProvider="AspNetSqlProvider"> <properties> <add name="RecentlyViewedItems" type="RecentlyViewedItems" serializeAs="Binary" /> </properties> </profile> <compilation debug="true"/> </system.web> </configuration> Configuration sections <system.web> configuration section group

Key Configuration Sections Name Description <appSettings> Contains user-defined strings <connectionStrings> Contains database connection strings <authentication> Sets the authentication type (e.g., Windows, forms, etc.) <authorization> Contains URL directives specifying who has access to which resources <compilation> Specifies run-time compilation settings <customErrors> Identifies custom error pages and related settings <profile> Defines profiles for persistent storage of per-user data

Defining a Global Error Page <configuration> <system.web> <customErrors mode="RemoteOnly" defaultRedirect="Error.aspx" /> </system.web> </configuration> Show global error page only to remote users (default) Redirect to Error.aspx when an unhandled exception occurs

Storing Connection Strings Web.config <configuration> <connectionStrings> <add name="Northwind" value="Server=localhost;Database=Northwind;..." /> </connectionStrings> ... </configuration> Programmatic Loading Dim northwind As String = _ ConfigurationSettings.ConnectionStrings ("Northwind").ConnectionString Declarative Loading <asp:SqlDataSource Runat="server" ... Text='<%$ ConnectionStrings:Northwind %>' />

Configuration Inheritance vroot <configuration> <system.web> <compilation defaultLanguage="c#" /> </system.web> </configuration> ASPX Web.config Subfolder1 Subfolder2 ASPX ASPX Web.config <configuration> <system.web> <compilation defaultLanguage="vb" /> </system.web> </configuration>

Machine.config Master ASP.NET configuration file* Many settings "baked into" ASP.NET run-time and documented in Machine.config.defaults Other settings declared in Machine.config Modify Machine.config to apply machine-wide configuration settings Consult Machine.config.comments for documentation on supported configuration settings and syntax * Found in %Windows%\Microsoft.NET\Framework\v…\CONFIG

Web Site Administration Tool GUI for managing configuration settings Invoke by requesting Webadmin.axd or with Website->ASP.NET Configuration command

IIS ASP.NET MMC Snap-In GUI for managing configuration settings Invoke through Internet Services Manager in Control Panel

Encrypting Config Sections Most config sections can be encrypted Beta 2 will include tool support; Beta 1 does not Encryption is transparent to applications ' Encrypt the <connectionStrings> configuration section Dim config As Configuration = _ Configuration.GetWebConfiguration (Request.ApplicationPath) Dim section As ConfigurationSection = config.Sections ("connectionStrings") If Not section.IsProtected Then section.ProtectSection ("DataProtectionConfigurationProvider") config.Update () ' Save to disk End If

Programming ASP.NET ASP.NET Configuration Run ProtectSection.aspx and demonstrate how to encrypt and decrypt the <connectionStrings> section of Web.config. Also demonstrate how to start the Web Site Administration Tool from Visual Studio, and how to launch the ASP.NET MMC snap-in. Demonstrate how to enable debugging using the Web Site Administration Tool and how doing so modifies Web.config. Copyright © 2001-2002

Global.asax Repository for global event handlers Handlers for global events fired as requests travel through ASP.NET's HTTP pipeline (per-request events) Handlers for other global events (e.g., Error, Application_Start, Application_End) Maximum of one per application Must be located in application root

The HTTP Pipeline Global Events (Pre-Request) HTTP Handler Request Authenticate- Request Resolve- RequestCache PreRequest- HandlerExecute BeginRequest Authorize- Request Acquire- RequestState HTTP Handler Request Response EndRequest Update- RequestCache Release- RequestState PostRequest- HandlerExecute Global Events (Post-Request)

Global Event Handlers Application_EventName syntax connects handler to event Optional @ Import directives import namespaces <%@ Import Namespace="System.Data" %> <script language="VB" runat="server"> Sub Application_BeginRequest (ByVal sender As Object, ByVal e As EventArgs) Dim app As HttpApplication = CType (sender, HttpApplication) ... End Sub ' Include other event handlers as needed </script> HttpApplication class provides access to request, response, and other infrastructure

Programming ASP.NET Global.asax Uncomment Application_BeginRequest in Global.asax and demonstrate that requests from localhost now throw an exception (401 Not Authorized). Walk through the code in Global.asax. Copyright © 2001-2002

Components Two component models Two ways to deploy managed components ASP uses COM components (difficult) ASP.NET uses managed components (easy) Two ways to deploy managed components ~/bin directory - Precompiled assemblies ~/Code* directory - Autocompiled assemblies * Directory name will change to Application_Code in beta 2

The bin Directory Introduced in ASP.NET 1.0; supported in 2.0 Private deployment of precompiled types vroot ASP.NET automatically consults assemblies in "bin" directory to resolve type references bin Other Folders DLL

The Code Directory New in ASP.NET 2.0 (no analogue in 1.x) Private deployment of autcompiled types vroot ASP.NET automatically compiles source code files in "Code" directory and uses resultant assemblies to resolve type references Code Other Folders VB

Resources Images, localization strings, etc. Declared in RESX files Visual Studio provides great design-time support for RESX creation and editing RESX files in ~/Resources* directory are automatically compiled by ASP.NET Once compiled, resources can be loaded declaratively or programmatically * Directory name will change to Application_Resources in beta 2

The Resources Directory New in ASP.NET 2.0 (no analogue in 1.x) Private deployment of autocompiled RESXes vroot ASP.NET automatically compiles RESX files in "Resources" directory Resources Other Folders RESX

Loading Resources AppResources.resx String resource Programming ASP.NET Loading Resources AppResources.resx Greeting Hello! String resource Resource name: "Greeting" Resource value: "Hello!" Declarative Loading <asp:Label ID="Output" Runat="server" ... Text='<%$ Resources:AppResources, Greeting %>' /> Run Localize.aspx. Open it in source view and show the expressions that declaratively load string resources and use them to initialize the control properties. Show the autocompiled RESX files in the Resources directory. Then change the browser's language preference and refresh the page. Finally, point out the Culture="auto" and UICulture="auto" attributes in the @ Page directive. Programmatic Loading Output.Text = Resources.AppResources.Greeting ' Strong typing! Copyright © 2001-2002

Programming ASP.NET Using Resources Copyright © 2001-2002

© 2003-2004 Microsoft Corporation. All rights reserved. Programming ASP.NET © 2003-2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary. Copyright © 2001-2002