Chapter 1

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 43

Chapter 1

At the end of this lesson, you will be able to:


Differentiate the key differences between

dynamic and static Web pages. Compare the ASP and ASP.NET technology. Evaluate the .NET Framework. Explore the Visual Studio 2008. Install the Web Server (IIS). Examine how ASP.NET works. Create a simple ASP.NET page.

What Is a Static Web Page?


The content (text, images, hyperlinks, and so on)

and appearance of static Web pages is always the same. If you surf the Web, you'll see many static Web pages.

Static Web Pages

Static Web pages limit you in several ways. Static pages can be very fast, as quick as copying a small file over a network, but they cannot provide any dynamic features.

What Is a Dynamic Web Page?


The appearance of dynamic Web pages is

generated dynamically at run time. Thus the contents are not always the same. Amazon.com is a good example.

There are two ways in creating Dynamic Web Pages:


Client-Side Dynamic Web Pages

Server-Side Dynamic Web Pages

Client Side Dynamic Web Pages

Server-side Dynamic Web Pages

ASP.NET is a powerful and flexible server-side technology (not programming language) for creating dynamic Web pages. ASP.NET is a server-side technology that lets you use fully fledged programming languages to create your Web pages. ASP.NET pages can be made from one of many languages. ASP.NET is only one of a set of technologies that comprise the .NET Framework.

ASP is restricted to using scripting languages, mainly JavaScript or VBScript. ASP.NET has no such problems. It allows you to use a far greater selection of full programming languages and fully utilize the rich potential of the .NET Framework. Typical languages supported natively are C#, J#, VB.NET. On top of this, it is expected that third party developers will create versions of Perl, Python, and many others to work in ASP.NET.

A more complete listing of the releases of the .NET Framework may be found on the .NET Framework version list.

Version 1.0 1.1 2.0 3.0

Release Date Visual Studio 2002-02-13 2003-04-24 2005-11-07 2006-11-06 VS.NET VS.NET 2003 VS.NET2005

Default in Windows

Server 2003

Vista, Server 2008 VS.NET 2008 Windows 7, Server 2008 R2

3.5

2007-11-19

The .NET Framework is an integral Windows component for building and running the next generation of software applications and Web services. The .NET Framework: Supports over 20 different programming languages. Enabling developers to focus on the core business logic code. Makes it easier than ever before to build, deploy, and administer robust, and high-performing applications. The .NET Framework is composed of the common language runtime and a unified set of class libraries.

VB

C#

C++

JScript

J#...

Common Language Specification Visual Studio .NET

ASP.NET
Web Services

Web Forms Windows Forms

ADO.NET and XML Base Class Library CLR CLI

.NET Framework 3.0 = .NET Framework 2.0 + WPF + WCF + WF + WCS


WPF : WCF : WF : WCS : Windows Windows Windows Windows Presentation Foundation Communication Foundation Workflow Foundation CardSpace

What about .NET Framework 3.5?

Reading:
http://msdn.microsoft.com/en-us/library/bb332048.aspx

We can break down our discussion of the entire .NET Framework into several core concepts:

Common Intermediate Language (CIL/MSIL) Common Language Runtime (CLR) .NET Framework class libraries .NET languages Windows forms ASP.NET Web services

For many years, there's been a simple choice between two types of compilation that differ when it comes to compilation:
Pre-compiled code - the code is compiled when we are done writing it and

well before we need to use it - Very fast execution

Interpreted code - this code is compiled at the time of its execution

(when the user requests the page) - Slower because we do a compilation for each request

What are the differences between these two?

.NET solves the problem by using a two-step process for compilation.


Common Intermediate Language (CIL)

Common Language Runtime (CLR)

CIL and the CLR together give us the best of both worlds:
The structural optimization of pre-compiled code

along with the portability of interpreted code.

We can therefore use all compliant languages interchangeably within our applications allows different teams to work on the same Web site in different languages.

The CLR is responsible for executing your application code. When you write an application for the .NET Framework with a language such as VB .NET or C#, your source code is never compiled directly into machine code.

Instead, the VB or C# compiler converts your code into a special language named:
MSIL (Microsoft Intermediate Language)

or
CIL (Common Intermediate Language)

MSIL/CIL looks very much like an objectoriented assembly language. However, unlike a typical assembly language, it is not CPU specific. MSIL is a low-level and platform-independent language. When execute, the compiled MSIL/CIL passed to CLR. CLR uses another compiler JIT (Just-in-time) compiler to compile to true machine code and make any last minute machine-specific optimization to the program, so that it can run as quickly as possible in the local machine.

The entire application is not compiled from MSIL into machine code. Instead, only the methods that are actually called during execution are compiled. In reality, the .NET Framework understands only one language: MSIL. However, you can write applications using languages such as Visual Basic .NET and C# for the .NET Framework

Because the .NET Framework includes compilers for these languages that enable you to compile your code into MSIL. You can write code for the .NET Framework using any one of dozens of different languages, including
Ada, Apl, Caml, COBOL, Eiffel, Forth, Fortran,

JavaScrip, Oberon, PERL, Pascal, PHP, Python, RPG, Scheme, Small Talk

Compile into machine code

code

Application

Traditional Method

compile

Compile into machine code

code

CIL / MSIL

CLR

Application

In the .NET Framework

Visual Studio 2008 is Microsoft's flagship software development product for computer programmers. It centers on an integrated development environment (IDE) which lets programmers to create
Standalone applications
Web applications Web services

The Visual Web Developer 2008 Express is a free IDE that allows anyone to evaluate the Web development and editing capabilities of the Visual Studio 2008 at no charge. You may get a copy from this Web site:

http://www.microsoft.com/exPress/download/

ASP.NET Web Matrix is a free IDE provided by Microsoft for developing ASP.NET applications. You may get a copy from this Web site:
http://www.asp.net/downloads/archived/web-

matrix/
* Microsoft is no longer support this product as its been replaced by the free Visual Web Developer 2008 Express Edition

Exploring Visual Studio 2008

Web servers are software that manage Web pages and make them available to client browsers via a local network or over the Internet (two different machines or same machine). There are many Web servers available (the common ones being Apache, Internet Information Services (IIS), and iplanet Enterprise Server) To test or run ASP.NET Web applications, you need a Web server Internet Information Services (IIS) UltiDev Cassini Web Server ASP.NET Development Server

IIS Web server comes bundled with Windows 2000, Windows XP Professional, and Windows Server 2003.

You can install Microsoft's Web server, Internet Information Server (IIS) for free from the Windows installation CD and configure it to run on your system. Only run on Windows 2000 and above. Download link:
http://www.iis.net/downloads

Think of ASP.NET pages as normal HTML pages that have sections marked up for special consideration. When .NET is installed, the local IIS Web server is automatically configured to look out for files with the extension ASPX and to use the ASP.NET module (a file called aspnet_isapi.dll) to handle them.

Simple example
Creating a simple ASP.NET page by saving your

ASP.NET file with an ASPX suffix.

Dynamic and Static Web Pages ASP and ASP.NET Introducing the .NET Framework Exploring the Visual Studio 2008 Installing a Web Server How ASP.NET Works Creating Our First ASP.NET Web Page

You might also like