Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Microsoft C# Professional Projects - Premier Press.pdf
Скачиваний:
177
Добавлен:
24.05.2014
Размер:
14.65 Mб
Скачать

430 Project 4 CREATING AN AIRLINE RESERVATION PORTAL

In the previous chapter, Chapter 18, “Project Case Study and Design,” you studied the case of SkyShark Airlines. You also saw the database schema and Web

forms that provide the interface to the application.

All the forms that you viewed in the last chapter are Web forms that are created in ASP.NET. The Web application ASP.NET is the next version of ASP (Active Server Pages) 3.0. However, ASP.NET is quite different from ASP because it includes a completely revamped ASP engine and uses the CLR (common language runtime) environment for running ASP code.

You will see in this chapter that ASP.NET simplifies Web development by allowing you to separate programming logic from the HTML code that is used to display the page. ASP.NET also provides improved caching and debugging support.

You can write programming logic in ASP.NET by using Visual Basic .NET or Visual C#. In this chapter, I will explore the basic concepts related to ASP.NET, which will help you to start creating the SkyShark Airlines project. The subsequent chapters will build on the concepts covered in this chapter and help you consolidate your learning of ASP.NET.

Visual Studio .NET provides a highly user friendly and powerful interface to simplify development in ASP.NET. For example, the ASP.NET Web application and ASP.NET Web service project templates can be conveniently used to develop Web applications and Web services. These templates provide the Web form and HTML controls that allow you to design a Web form without needing to write a single line of code. Another important aspect that I will explain in this chapter is the use of Visual Studio .NET for creating ASP.NET applications.

Getting Started with ASP.NET

ASP.NET is a server-side scripting technology that allows you to create dynamic Web sites. ASP.NET is built upon the .NET framework. In this section, I’ll explore the new features and the types of applications that you can create in ASP.NET. However, before that, I’ll examine the prerequisite software package that is required to create and run ASP.NET applications.

BASICS OF ASP.NET WEB APPLICATIONS

Chapter 19

431

 

 

 

 

Prerequisites for ASP.NET Applications

ASP.NET is a component of .NET Framework SDK (Software Development Kit). ASP.NET can be downloaded free of cost from the Microsoft site at http://msdn.microsoft.com. The software requirements to install the SDK are specified in the following list:

Windows XP Server or Windows XP Professional

Windows 2000 Server or Windows 2000 Professional

Windows NT 4.0 with Service Pack 6a

IIS (Internet Information Server) 5.0 or a later version

In an enterprise environment, you have different development servers and deployment servers. The development servers are used to develop the applications, and the deployment servers are the Web servers on which the application is deployed. You need not install .NET Framework SDK on the deployment servers. Instead, you can install .NET Framework Redistributable, which is also downloadable from the Microsoft Web site.

New Features in ASP.NET

After having examined the prerequisites to run ASP.NET, I will examine the new features of ASP.NET. The most important features of ASP.NET are specified in the following list:

Compiled code. One of the most prominent differences between ASP and ASP.NET is that the code in ASP.NET is compiled while the code in ASP 3.0 is interpreted. The compilation of code significantly improves the performance of the Web application. It also allows early binding and strong typing of the program code.

Support for multiple programming languages. ASP.NET supports Visual Basic .NET, Visual C#, and JScript. You can use any of these three languages to write your code. You can also use a combination of all three languages to develop your Web application. The development team might code one module for the application in Visual Basic .NET and another in Visual C# and JScript.

Support for WYSIWYG (what you see is what you get) editors. Similar to ASP 3.0, ASP.NET applications can be coded in WYSIWYG

432 Project 4 CREATING AN AIRLINE RESERVATION PORTAL

HTML editors. In this project, the Visual Studio .NET development platform that you will use to develop the SkyShark Airlines project is a WYSIWYG editor.

Improved caching. ASP.NET optimizes the performance of request processing by providing extensive caching support. ASP.NET exposes a cache API to help programmers cache their own objects. This allows programmers to have greater control over caching of their content. The data in ASP.NET can be cached at two levels, page and fragment. Pagelevel caching enables you to cache a complete page, and fragment caching enables the caching of only a part of a page.

Extensive security. ASP.NET applications can use Windows, Forms, and Microsoft Passport authentication mechanisms. In ASP 3.0 applications, security is configured at IIS. ASP.NET takes the security model to the next step by allowing you to configure security at the IIS and Web application. You can also enable directory-level security for your Web application. I will explain ASP.NET security in detail later in this chapter and in Chapter 25, “Securing the Application.”

Debugging and tracing. An important task in application development is debugging and tracing. When you build your ASP.NET application in Visual Studio .NET, you can use the extensive debugging tools and tracing methods to debug your application.

Efficient state management. State management is the process of maintaining state and page information over multiple requests for the same or different pages. ASP.NET provides easy-to-use application and sessionstate capabilities. Session and application data can be stored in userdefined objects, which can be updated or queried from time to time.

Improved data access. The ADO.NET architecture provides a reliable and efficient mode of accessing data. Although the topic of ADO.NET is too complicated to cover in a single chapter, I will use the ADO data objects extensively in this project.These objects are explained as they are used.

After having examined the features of ASP.NET, you can now examine the applications that can be created in ASP.NET.

BASICS OF ASP.NET WEB APPLICATIONS

Chapter 19

433

 

 

 

 

Types of ASP.NET Applications

InASP.NET, you can create two types of applications: Web applications and Web services. In this section, I include a brief description of these applications.

ASP.NETWeb Applications

ASP.NET Web applications are applications that interact directly with users through the Internet. The Web sites that you commonly browse on the Internet are Web applications. The Web applications that are built using ASP.NET are ASP.NET Web applications. I will explain ASP.NET Web applications in this project in detail.

ASP.NETWeb Services

Consider a scenario where you need to consolidate the data that is available on three data sources and display it on a Web site.The only way to display output by using Web applications is to create different Web applications and provide links to all applications on a Web site. However, consider that the data that you need to access may be stored on legacy systems and the data may be relevant only when it is consolidated and analyzed.

Implementing such a scenario by using Web applications can be a challenging task. Here, the solution is in ASP.NET Web services. Web services expose the functionality provided by one application to other applications. The functionality exposed by a Web service can be implemented by other Web services or applications in a number of ways, depending upon the business requirements of Web service clients. Therefore, a Web service that exposes a product catalog can be displayed on one Web application as a list and on another Web application with the custom search functionality.

Another advantage offered by Web services is that they are platform-independent. Data is exposed by Web services in an XML format, which is the industry standard.Therefore, any device that can interpret XML can make use of the data that is available from the Web service. I will discuss more of Web services in the next professional project, “Project 5: Creating a Web Portal for a Bookstore.”