Contents • Active Server Pages – ASP and HTML – ASP and ASP.NET • ASP and .NET – What is .NET? – Managed and Unmanaged Execution • .NET Framework – Common Type System – Common Language Specification. – Common Language Runtime. – Compilation and Execution. • ASP.NET Architecture – ASP.NET Application Types. – ASP and ASP.NET
Active Server Pages • Web pages containing server-side scripts in addition to Text and HTML Tags. • It runs inside the IIS. • Server-side scripts are special commands in Web pages that are processed before the pages are sent from Web Server to the Web Browser of client. • When Browser requests ASP File, IIS passes request to ASP Engine. • ASP Engine reads ASP File line by line, executes scripts and ASP File is returned to Browser as a plain HTML File.
HTML and ASP HTML ASP • Server-side Scripts cannot • Server-side Scripts can be be written in HTML. written using ASP. • Scripts denoted by • Scripts denoted by delimiters : < > delimiters: <% %> • Cannot access any • Can access any Data or Database. Database. • Scripts can be viewed from • Scripts cannot be viewed the Browser. from the Browser. • Pages are Static. • Pages are Dynamic. • Pages denoted by .html • Pages denoted by .asp or .htm or .aspx for ASP.NET
.NET and ASP • What is .NET? – Platform Neutral Framework from Microsoft – Is a layer between the operating system and the programming language. – It supports 24 programming languages: • Visual Basic, C# , J# , C++, Perl etc. – .NET provides a common set of class libraries, which can be accessed from any .NET based programming language. • Managed and Unmanaged Execution Environment – Unmanaged Code : Converted directly into Native Code. – Managed Code : Converted to an Intermediate Language which can be executed from any environment having the .NET Framework.
.NET Framework VB C++ C# JScript … V Common Language Specification isua ASP.NET Windows Forms l Stu ADO.NET and XML d io Base Class Library .N E T Common Language Runtime Operating System
Inside the .NET Framework • Common Type System [CTS]: Provides every language running on .NET platform with a base set of Data Types. – Everything in the CTS is an object – Most languages implement aliases to those types – e.g. a four-byte integer value is represented by the CTS type System.Int32 but C# defines an alias for this type called int. • Common Language Specification [CLS] The CLS is a set of rules that a language compiler must follow in order to create .NET applications – The CLS defines the following things Common variable types (called CTS ) Common visibility like when and where can one see these variables, Common method specifications, and so on.
Inside the .NET Framework Contd… • Common Language Runtime [CLR] Manages the execution of code compiled for the .NET platform. Fol owing Steps occur in CLR: – Managed Code created by VB or C# compilers and converted into MSIL. – MSIL contains the IL Code and the METADATA. – MSIL is kept in a file called ASSEMBLY along with Metadata. – CLR loads and verifies the assembly to make sure that IL is ok. – Just In Time Compiler [JIT] in CLR converts this IL to machine code. – Garbage Collector - Automatic allocation and release of Memory. – Base Class Library allow us to interact with the runtime, and provide additional useful functionality. Provides services and Objects needed to write applications.
ASP.NET Architecture • Web clients communicate with Web Clients ASP.NET applications through IIS. • IIS authenticates the request. ASP.NET • If “Al ow Anonymous” is turned Applications IIS on, no authentication occurs. • IIS also finds the requested .NET resource. Framework • If the Client is authorized, IIS returns the appropriate resource. Windows NT/2000/XP Operating System
ASP.NET Application Types • Two types of Applications: – Web Forms: – XML web services. • Web forms al ow us to build form-based web pages .We can use ASP.NET server controls to create common UI elements, and program them for common tasks . • XML Web services are software applications that use XML to exchange data (information) with other applications on other computers by using Internet protocols.
ASP.NET and ASP ASP.NET ASP • Multiple language Support • Only scripting languages
supported • ASP.NET pages are compiled. • ASP pages are interpreted. • Functional Codes separated • Both HTML and script are from presentation code. present in a single page. • Browser-independent • Browser-dependent applications. applications. • Memory leak, deadlock, and • No such protections available in crash protection. classical ASP. • Better performance due to • ASP pages are not compiled caching of code during hence performance is not good compilation. as compared to ASP.NET. • Provides more security and • Security and Stability is not stability because of the .NET optimum as compared to Framework. ASP.NET