User:Unnikrishnan85

Web applications are one of four types of Internet applications that you can create using Visual Studio .NET and Microsoft ASP.NET. In this lesson, you will learn a little about the different types of Internet applications and get an overview of how a Web application works.

After this lesson, you will be able to Describe four different types of Internet applications and know where to look for training on developing each type of application

Explain how a Web application executes over the Internet and how that differs from a traditional, static Web site

Understand the role that ASP.NET plays in creating Web applications

List the parts that make up ASP.NET and describe some of its advantages over other Web application technologies, such as the Common Gateway Interface (CGI)

Estimated lesson time: 5 minutes What Can You Create? Strictly speaking, an Internet application is any application that uses the Internet in any way. That means applications that request users register over the Internet or that provide Help through the Internet are, to some degree, Internet applications.

That definition is too broad for the subject of a single book. To narrow the focus a bit, let' s identify four types of Internet applications:

Web applications. These provide content from a server to client machines over the Internet. Users view the Web application through a Web browser, such as Microsoft Internet Explorer or Netscape Navigator.

Web services. These components provide processing services from a server to other applications over the Internet.

Internet-enabled applications. These are stand-alone applications that incorporate aspects of the Internet to provide online registration, Help, updates, or other services to the user over the Internet.

Peer-to-peer applications. These are stand-alone applications that use the Internet to communicate with other users running their own instances of the application.

You can use Visual Studio .NET to create each of these types of applications. The first type, Web applications, is the subject of this book. Table 1-1 shows the Visual Studio .NET Help topics and the books in this series that deal with each type of Internet applications.

Table 1-1 Sources of Information about Internet Applications Application type Use these topics in online Help Prepare for the MCSD test using Web applications ASP.NET, Web Forms, System.Web namespace This book. Web services ASP.NET, XML Web Services, System.Web.Services namespace MCSD Training Kit: Developing Web Services and Server Components Internet-enabled applications Windows forms, HTML Help, WebBrowser control, System.Net namespace MCSD Training Kit: Developing Windows Applications with the Microsoft .NET Framework or Desktop Applications with Microsoft Visual C++ 6.0 MCSD Training Kit Peer-to-peer applications Accessing the Internet, pluggable protocols, System.Net.Sockets namespace MCSD Training Kit: Developing Web Services and Server Components

How Web Applications Work Web applications use a client/server architecture. The Web application resides on a server and responds to requests from multiple clients over the Internet, as shown in Figure 1-1.

Figure 1-1 Web application architecture On the client side, the Web application is hosted by a browser, such as Internet Explorer or Netscape Navigator. The application' s user interface takes the form of Hypertext Markup Language (HTML) pages that are interpreted and displayed by the client' s browser.

On the server side, the Web application runs under Microsoft Internet Information Services (IIS). IIS manages the application, passes requests from clients to the application, and returns the application' s responses to the client. These requests and responses are passed across the Internet using Hypertext Transport Protocol (HTTP). A protocol is a set of rules that describe how two or more items communicate over a medium, such as the Internet. Figure 1-2 shows how the client and server interact over the Internet.

Figure 1-2 Client/server interaction in a Web application The Web application composes responses to requests from resources found on the server. These resources include the executable code running on the server (what we traditionally think of as the “application” in Microsoft Windows programming), Web Forms, HTML pages, image files, and other media that make up the content of the application.

Web applications are much like traditional Web sites, except that the content presented to the user is actually composed dynamically by executable, rather than being served from a static page stored on the server. Figure 1-3 shows how a Web application composes the HTML returned to a user.

Figure1-3 A Web application response from server resources The executable portion of the Web application enables you to do many things that you cannot do with a static Web site, such as:

Collect information from the user and store that information on the server.

Perform tasks for the user such as placing an order for a product, performing complex calculations, or retrieving information from a database.

Identify a specific user and present an interface that is customized for him or her.

Present content that is highly volatile, such as inventory, pending order, and shipment information.

This is only a partial list. Basically, you can do anything with a Web application that you can imagine doing with any client/server application. What makes a Web application special is that the client/server interaction takes place over the Internet.

What ASP.NET Provides ASP.NET is the platform that you use to create Web applications and Web services that run under IIS. ASP.NET is not the only way to create a Web application. Other technologies, notably the CGI, also enable you to create Web applications. What makes ASP.NET special is how tightly it is integrated with the Microsoft server, programming, data access, and security tools.

ASP.NET provides a high level of consistency across Web application development. In a way, it is similar to the level of consistency that Microsoft Office brought to desktop applications. ASP.NET is part of the .NET Framework and is made up of several different components.

Visual Studio .NET Web development tools. These include visual tools for designing Web pages and application templates, project management, and deployment tools for Web applications.

The System.Web namespaces. These are part of the .NET Framework, and include the programming classes that deal with Web-specific items such as HTTP requests and responses, browsers, and e-mail.

Server and HTML controls. These are the user-interface components that you use to gather information from and provide responses to users.

In addition to the preceding components, ASP.NET also uses the following, more general programming components and Windows tools. These items aren' t part of ASP.NET. However, they are key to ASP.NET programming.

Microsoft Internet Information Services (IIS). As mentioned in the previous section, IIS hosts Web applications on the Windows server.

The Microsoft Visual Basic .NET, Microsoft Visual C#, and JScript programming languages. These three languages have integrated support in Visual Studio .NET for creating Web applications.

The .NET Framework. This is the complete set of Windows programming classes; they include the ASP.NET classes as well as classes for other programming tasks such as file access, data type conversion, array and string manipulation, and so on.

ADO.NET database classes and tools. These components provide access to Microsoft SQL Server and ODBC databases. Data access is often a key component of Web applications.

Microsoft Application Center Test (ACT). This Visual Studio .NET component provides an automated way to stress-test Web applications.

ASP.NET is the most complete platform for developing Web applications that run under IIS. However, it is important to remember that ASP.NET is not platform-independent. Because it is hosted under IIS, ASP.NET must run on Windows servers. To create Web applications that run on non-Windows/IIS servers, such as Linux/Apache, you must use other tools—generally CGI.

Advantages of ASP.NET ASP.NET has many advantages over other platforms when it comes to creating Web applications. Probably the most significant advantage is its integration with the Windows server and programming tools. Web applications created with ASP.NET are easier to create, debug, and deploy because those tasks can all be performed within a single development environment—Visual Studio .NET.

ASP.NET delivers the following other advantages to Web application developers:

Executable portions of a Web application compiled so they execute more quickly than interpreted scripts

On-the-fly updates of deployed Web applications without restarting the server

Access to the .NET Framework, which extends the Windows API

Use of the widely known Visual Basic programming language, which has been enhanced to fully support object-oriented programming

Introduction of the new Visual C# programming language, which provides a type-safe, object-oriented version of the C programming language

Automatic state management for controls on a Web page (called server controls) so that they behave much more like Windows controls

The ability to create new, customized server controls from existing controls

Built-in security through the Windows server or through other authentication/authorization methods

Integration with Microsoft ADO.NET to provide database access and database design tools from within Visual Studio .NET

Full support for Extensible Markup Language (XML), cascading style sheets (CSS), and other new and established Web standards

Built-in features for caching frequently requested Web pages on the server, localizing content for specific languages and cultures, and detecting browser capabilities