AgendaIntro to.NET
What is .NET and Important components
Compilation Model
Incremental .NET Framework Stack
CLR Versions andSide By side Execution
ASP.NET
The .NET Framework is
an execution and
development
platform for building
apps for Windows,
Windows Phone ,Windows
Server and Web
Services...
Framework Class
Library
Common Language Runtime
.NET Framework
Is run-time environment to execute .NET Apps
Code ExecutionException HandlingResource ManagementGarbage CollectionCode Access SecurityJust In Time CompilationLanguage Interoperability
• Library of tested, reusable code that developers can use in own applications
• Consists of classes, interfaces, and structures, delegates etc.
• Categorized using Namespaces
lpu
Console Applications
Windows Services
Client/Desktop
Applications
Win Forms
WPF
Server/Web Applications
ASP.NET Web
Forms
ASP.NET MVC
XML Web Services
WCF Services
Win Store Apps
lpu
OS
CLR
Executed by CLR
Executed by OS
OS
Classic Compilation Vs. .NET Compilation
Machine Code
JIT
Assembly [CIL]
C# Compiler
C# Source Code
Machine Code
C Compiler
C Source Code
Using FCL Classes
FCL Assemblie
s
lpu
Assembly Manifest
Type Metadata
Resources
CIL
Assembly
Meta Information
• Common Intermediate Language• Earlier called Microsoft Intermediate Language
or MSIL or IL• Also referred as Managed Code• Is an object-oriented assembly language• Advantages
• Platform Independence• Language Independence
• Information about all types used in source code
lpu
• Consist of Meta-information and CIL• Basic Building blocks of .NET Framework• Self Descriptive• Two Types
• Private • Public
• Information about assembly• Assembly name• Assembly Version• Security Key• References to other assemblies used
Platform Independence
Machine Code
JIT
Assembly Loader
Assembly / PE (exe / dll)
Meta Information CIL Code
C# Compiler
C# Source Code(Uses ref of dlls from FCL)
Development PlatformProduction Platform
.NET Framework
CLR
FCL
Assembly / PE
FCL Class Ref
lpu
Language Independence
VB.NET Code
VB.NET Compiler
C# Code
C# Compiler
CIL
JIT
Native Code
F# / C++.NET/ Any
CLS compatible
Lang Compiler
FCLCLR
CLR
CLS works with the CTS to ensure language interoperabilityThe CLS is a set of minimum standards that all compilers targeting .NET must support.
GCCAS
CLSJIT CTS
FCL
Common Type System defines the setpredefined data types available in IL
• Compiles CIL to Machine code• compiles portion of code as it is called.
And cached
Code Access Security Applies the permission to code, based on source of code and other identities
• garbage collector manages the allocation and release of memory for your application.
• Reclaims unreferenced or dead objects and clears their memory.
Is run-time environment to execute .NET AppsCommercial implementation of CLI by Microsoft
Code ExecutionException HandlingResource ManagementGarbage CollectionCode Access SecurityJust In Time CompilationLanguage InteroperabilityApplication Isolation
• Common Language Infrastructure is an international standard that is the basis for creating execution and development environments in which languages and libraries work together seamlessly.
CLR 1.1
FCL 1.1
CLR 2.0
FCL 2.0
CLR 4.0
FCL 4.0
CLR 4.5
FCL 4.5
FCL 3.0
FCL 3.5
CLR 1.0
FCL 1.0
CLR Versions
Side By Side Execution Allows multiple versions of the Framework to be installed on a single system
2002 20052003 2010 2012
ASP.NET
• Asp.net is an open-source server-side Web application framework designed for Web development to produce dynamic Web pages. It was developed by Microsoft to allow programmers to build dynamic web sites, web applications and web services.
• first released in January 2002 with version 1.0 of the .NET Framework.• 1)Web forms 2)MVC
ASP Architecture
IIS (asp.net_isapi.dll)(Internet Information Server)
Client
Server
Request:http://www.msn.com/default.aspx
Response:<html>…</html>
Network HTTPTCP/IP
PC/Mac/Unix + Browser (IE, FireFox)
Web Forms
• Web Forms are pages that users request using their browser. These pages can be written using a combination of HTML, client-script, server controls, and server code. An ASP.NET Web Forms page presents information to the user in any browser or client device.
• The ASP.NET Web Form is separated into two logical areas:
• The template (designing code).
• A collection of code behind the Web Form .
Code behind model
• Microsoft recommends dealing with dynamic program code by using the code behind model, which places this code in a separate file or in a specially designated script tag.
• Code behind files typically have names like MyPage.aspx.cs while the page file is MyPage.aspx.
Directives
• A directive is a special instruction on how ASP.NET should process the page.
• The Most Common directive is <%@ Page %> which can specify many attributes used by the A SP.NET page parser and compiler.
• Example:
<%@ Page Language="C#" AutoEventWireup=“True" CodeFile="Default.aspx.cs" Inherits="Default" %>
• When AutoEventWireup is true, ASP.NET automatically treats a method of name Page_eventName as an event handler
WEB SERVER CONTROLS
• TextBox
• Button
• Radio Button/Radio Button List
• CheckBox/ CheckBox List
• HyperLink/Link Button
• Fileupload Control
• Dropdown List/List Box
VALIDATIONS
Validations is a Process of checking the user input for Various checks before the form is submitted to the server.
• Compare Validator
• Required Field Validator
• Range Validations
• Validation Summary
• Regular Expression Validator
WEB SERVICES
• Web services can be defined as a piece of code that runs on a web server and provides data to the requesting clients.
Characteristic's of Web Services :
1) It’s a logic and does not contain UI.
2) Web services are hosted on webserver.
3) Web services transfer data in the form of XML/JSON
4) They are Platform Independent
5) Web services interact with the Database.
6) Web services are normally in the form of classes and public methods.
SOAP : SOAP means Simple Object Access Protocol which is used to invoke a web service hosted on the network
SESSIONS
• USER 1----------> ------SESSION 1----->
• USER 2----------> ------SESSION 2----->
• ! !
• USER N---------> ------SESSION N----->
WEB SERVERAPPLICATION
COOKIES
• Cookies are used to store small piece of information on the client side.
• Gmail, Hotmail and other websites they use cookies for the purpose of signing in and maintaining certain information
ASP VS ASP.NET
ASP ASP.NET
ASP is interpreted. ASP.NET is compiled.
ASP has Mixed HTML and coding logic . Asp.net html and coding part are separated by code behind files.
ASP.NET purely object oriented. ASP is partially object oriented.
For ASP No in-built support for XML ASP.NET full XML Support for easy data exchange
ASP has no inbuilt facility for Validation of controls
ASP has inbuilt facility for Validation of controls