21
Architecture Of ASP.NET

Architecture Of ASP.NET. What is ASP? Server-side scripting technology. Files containing HTML and scripting code. Access via HTTP requests. Scripting

Embed Size (px)

Citation preview

Page 1: Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting

Architecture Of ASP.NET

Page 2: Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting

What is ASP?

Server-side scripting technology.

Files containing HTML and scripting code.

Access via HTTP requests.

Scripting code is interpreted on server side.

Page 3: Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting

What can I do with ASP?

Easily and quickly create simple Web applications.

Generate dynamic Web content.

Client-side scripting for validation.

Access COM components to extend functionality. Database

Page 4: Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting

ASP Shortcomings

Mixes layout (HTML) and logic (scripting code)

Interpreting ASP code leads to performance loss

Uses scripting languages that are not strongly typed Microsoft Jscript Microsoft Visual Basic Scripting Edition (VBScript)

Browser Compatibility

No real state management No state sharing across Web farms State is lost when IIS fails

Update files only when server is down

Page 5: Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting

What is ASP.NET ?

ASP.NET is a server side technology for developing web applications based on the Microsoft.NET framework.

ASP.NET is a server side technology.

In a client side technologies like HTML, Javascript and Cascading Style Sheets (CSS) the client is entirely responsible.

In server side technologies like ASP.NET, the server is responsible for creating web pages.

Page 6: Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting

ASP.NET is a technology for developing web applications. Web applications usually (but not always) store information in a

DB, and allow visitors to the site to access and change that information.

Many supported languages have been developed to create web applications: PHP, JSP, Ruby on Rails, CGI and ColdFusion.

ASP.NET lets you to write web applications using a variety of familiar programming languages.

ASP.NET uses the Microsoft.Net Framework. The .Net Framework collects all the technologies needed for

building windows desktop applications, web applications, web services and so on into a single package.

Page 7: Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting

How ASP.NET works?

Page 8: Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting

User : The transaction starts and ends with the user. The user operates the web client software and interprets the results.

Web Client : This is the software program that the person uses to interact to the web application. The client is usually a web browser, such as Internet Explorer or Firefox.

Web Server : This is the software program located on the server. It processes request made by the web client.

Page 9: Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting

Features of ASP.NET

Enhanced Performance ASP.NET is compiled common language runtime code running

on the server. Take advantage of early binding, just-in-time compilation, native

optimization and caching services.

World Class Tool Support WYSIWYG editing, drag and drop server controls and automatic

deployment.

Power and Flexibility Because ASP.NET is based on the Common Language Runtime. .NET Framework class library, Messaging and Data Access

solutions are all seamlessly accessible from the web.

Page 10: Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting

Simplicity The ASP.NET page framework allows you to build user

interfaces that cleanly separate application logic from presentation code and to handle events in a simple way.

CLR simplifies development with managed code services.

Manageability ASP.NET employs a text based, hierarchical configuration

system which simplifies applying settings to your server environment and web applications.

No server restart is required even to deploy or replace running compiled code.

Scalability and Availability Processes are closely monitored and managed by the ASP.NET

runtime, so that if one misbehaves(leaks, deadlocks), a new process can be created in its place.

Page 11: Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting

Customizability and Extensibility It is possible to extend or replace any subcomponent of the

ASP.NET runtime with your own custom-written component.

Security built in windows authentication and per application configuration,

you can be assured that your applications are secure.

Page 12: Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting

ASP.NET vs ASP

ASP.NET has better language support, a large set of new controls, XML-based components and better user authentication.

ASP.NET provides increased performance by running compiled code.

ASP.NET is not fully backward compatible with ASP.

Page 13: Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting

What is ASP.NET Web Forms ?

The ASP.NET Web Forms Page Framework is a scalable common language runtime programming model that can be called on the server to dynamically generate web pages.

It provides : The ability to create and use reusable UI controls that can encapsulate common functionality and thus reduce the amount of code that a page developer has to write. The ability for developers to cleanly structure their page logic in an orderly fashion. The ability for development tools to provide strong WYSIWYG design support for pages(existing ASP code is opaque to tools). Managed execution environment, type safety, inheritance and dynamic compilation. A set of state management features that preserves the view state of a page between requests.

Page 14: Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting

Challenges in Web Application

Implementing a rich Web User Interface

Separation of client and server

Stateless execution

Unknown client capabilities

Complications with data access

Page 15: Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting

ASP.NET addresses these Challenges

Intuitive, consistent object model

Event driven programming model

Intuitive state management

Browser-independent applications

.NET Framework common language runtime support

Page 16: Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting

In ASP.NET web pages, is divided into two pieces : the visual component and the logic.

The visual element consist of a file containing static markup such as HTML or ASP.NET server controls or both.

The ASP.NET Web Page works as container for the static text and controls you want to display.

The logic for the ASP.NET web page consist of code that you create to interact with the page.

The code can reside either in a script block in the page or in a separate class.

If the code is in a separate class file, this file is referred to as the code-behind file.

Page 17: Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting

ASP.NET Web Page Code Model

In ASP.NET Web Page consists of two parts : Visual Elements which include markup, server controls and static text. Programming logic for the page which includes event handlers and other code.

ASP.NET provides two models for managing the visual elements and code – the single - file page model and the code – behind page model.

The two models functions the same and you can use the same controls and code for both models.

Page 18: Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting

Single – File Page (In – Page) Model

In single – file page model, the page’s markup and its programming code are in the same physical .aspx file.

The programming code is in a script block that contains the attribute runat=“server” to mark it as code that ASP.NET should execute.

Page 19: Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting

Code – Behind Page Model

The code – behind page model allows you to keep the markup in one file – the .aspx file and the programming code in another file.

There are two differences in the .aspx page between the single – file and the code – behind models.

In the code – behind model, there is no script block with the runat=“server” attribute.

The second differences is that the @page directive in the code – behind model contains attributes that reference an external file (SamplePage.aspx.vb or SamplePage.aspx.cs) and a class. These attributes links the .aspx page to its code.

Page 20: Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting

Advantages of Single – File Pages

In pages where there is not very much code, the convenience of keeping the code and markup in the same file can outweigh other advantages of the code-behind model.

Pages written using the single-file model are slightly easier to deploy or to send to another programmer because there is only one file.

Because there is no dependency between files, a single file page is easier to rename.

Managing files in a source code control system is slightly easier, because the page is self-contained in a single file.

Page 21: Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting

Advantages of Code – Behind Pages

Code – behind pages offer a clean separation of the markup (user interface) and code. It is practical to have a designer working on the markup while a programmer writes code.

Code is not exposed to page designers or others who are working only with the page markup.

Code can be reused for multiple pages.