Presentation is loading. Please wait.

Presentation is loading. Please wait.

T U T O R I A L  2009 Pearson Education, Inc. All rights reserved. 1 28 Bookstore Web Application Introducing Visual Web Developer 2008 Express and the.

Similar presentations


Presentation on theme: "T U T O R I A L  2009 Pearson Education, Inc. All rights reserved. 1 28 Bookstore Web Application Introducing Visual Web Developer 2008 Express and the."— Presentation transcript:

1 T U T O R I A L  2009 Pearson Education, Inc. All rights reserved. 1 28 Bookstore Web Application Introducing Visual Web Developer 2008 Express and the ASP.NET Development Server

2  2009 Pearson Education, Inc. All rights reserved. 2 Outline 28.1 Multitier Architecture 28.2 Web Servers 28.3 Visual Web Developer 2008 Express and the ASP.NET Development Server 28.4 Test-Driving the Bookstore Web Application

3  2009 Pearson Education, Inc. All rights reserved. 3 In this tutorial you will learn: ■Understand the multitier architecture of data- driven web applications. ■Understand the process of requesting a resource from a web server and receiving a response from a web server. ■Use the ASP.NET Development Server that is built into Visual Web Developer 2008 Express to test web applications on your local computer. ■Use a web browser to interact with a web application. Objectives

4 Application Requirements  2009 Pearson Education, Inc. All rights reserved. 4 28.4 Test-Driving the Bookstore Web Application A bookstore employee receives e-mails from customers asking for information pertaining to the books the store provides online. Responding to the numerous e-mails can be a tedious and time-consuming task. The employee has asked you to create a web application that allows users to view information about various books online. This information includes the book’s cover image, author(s), ISBN number, edition number, copyright date and a brief description of the book.

5  2009 Pearson Education, Inc. All rights reserved. 5 ■Web applications are multitier applications that divide functionality into separate functional groupings (Fig. 28.1). ■The information tier maintains data for the application. ■The middle tier controls interactions between application clients (such as web browsers) and application data in the information tier. ■The client tier is the application ’ s user interface, which is typically a web browser. 28.1 Multitier Architecture

6  2009 Pearson Education, Inc. All rights reserved. 6 Figure 28.1 | Three-tier application model. 28.1 Multitier Architecture

7  2009 Pearson Education, Inc. All rights reserved. 7 ■A web server responds to client requests by providing requested resources. ■A URL (Uniform Resource Locator) is as an address that directs a browser to a resource on the web. –A URL contains a host name or an IP address that identifies the web server. ■ Localhost is a special host name that identifies the local computer. 28.2 Web Servers

8  2009 Pearson Education, Inc. All rights reserved. 8 ■The web browser interacts with a web server to retrieve and display the resource specified by the URL (Fig. 28.2). –The web browser uses the host name in the URL to locate the web server from which to request the resource. –The remainder of the URL after the host name specifies the path to the resource. –In the URL http://www.deitel.com/ResourceCenters.html, www.deitel.com is the host name and ResourceCenters.html specifies the path to an HTML document on the web server. 28.2 Web Servers (Cont.)

9  2009 Pearson Education, Inc. All rights reserved. 9 Figure 28.2 | Client interacting with a web server. Step 1: The request. 28.2 Web Servers (Cont.)

10  2009 Pearson Education, Inc. All rights reserved. 10 ■In response, the server first sends a message to the client that includes a numeric code and a phrase describing the status of the request (Fig. 28.3). –If the request is successful, the server sends the requested resource. –Otherwise, the web browser displays a message indicating that the resource was not found. 28.2 Web Servers (Cont.)

11  2009 Pearson Education, Inc. All rights reserved. 11 Figure 28.3 | Client interacting with a web server. Step 2: The response. 28.2 Web Servers (Cont.)

12  2009 Pearson Education, Inc. All rights reserved. 12 ■Use Visual Web Developer 2008 Express to test-drive and build web applications. ■Visual Web Developer includes the ASP.NET Development Server. –The ASP.NET Development Server is designed for learning and testing purposes. –The ASP.NET Development Server cannot respond to requests from other computers. ■You can also publish your application to a Microsoft Internet Information Services (IIS) web server to receive requests from any client on the web. 28.3 Visual Web Developer 2008 Express and the ASP.NET Development Server

13  2009 Pearson Education, Inc. All rights reserved. 13 ■Select File > Open Web Site... to display the Open Web Site dialog (Fig. 28.4). ■Click the File System button, and open the Bookstore application. Figure 28.4 | Opening the Bookstore web application. Test-Driving the Completed Bookstore Web Application Opening the completed ASP.NET web application

14  2009 Pearson Education, Inc. All rights reserved. 14 ■To specify a start page, right click the Books.aspx file in the Solution Explorer and select Set As Start Page (Fig. 28.5). ■Files with the extension. aspx contain the web page’s GUI. –A web application can contain several ASPX pages. Test-Driving the Completed Bookstore Web Application (Cont.)

15  2009 Pearson Education, Inc. All rights reserved. 15 Figure 28.5 | Setting Books.aspx as the web application’s start page. Test-Driving the Completed Bookstore Web Application (Cont.) Right click the Books.aspx page to display the pop-up menu Select this option to set the start page

16  2009 Pearson Education, Inc. All rights reserved. 16 ■Run the application (Fig. 28.6). ■This ListBox is actually a web control. ■Web controls look similar to their Windows Forms counterparts. Test-Driving the Completed Bookstore Web Application (Cont.) Figure 28.6 | Page that displays a list of available books. Button control ListBox control containing available books Label controls

17  2009 Pearson Education, Inc. All rights reserved. 17 ■The books displayed in the ListBox are retrieved from a database using a LINQ to SQL data source. ■Press the View Information Button without selecting a book. –The page responds by indicating that you must select a book first (Fig. 28.7). –Validation controls determine whether the data in another web control exists, is in the proper format, has the proper value or is within the proper range of values. Test-Driving the Completed Bookstore Web Application (Cont.)

18  2009 Pearson Education, Inc. All rights reserved. 18 Figure 28.7 | Validation control showing an error message. Test-Driving the Completed Bookstore Web Application (Cont.) RequiredFieldValidator control

19  2009 Pearson Education, Inc. All rights reserved. 19 Figure 28.8 | Displaying the selected book’s cover image. Test-Driving the Completed Bookstore Web Application (Cont.) Image control ■When you select a book an ItemSelected event occurs (Fig. 28.8).

20  2009 Pearson Education, Inc. All rights reserved. 20 Test-Driving the Completed Bookstore Web Application (Cont.) ■Click the View Information Button to display the BookInformation.aspx page (Fig. 28.9). Figure 28.9 | Page that displays the selected book’s information. When clicked, this Button returns user to Books.aspx


Download ppt "T U T O R I A L  2009 Pearson Education, Inc. All rights reserved. 1 28 Bookstore Web Application Introducing Visual Web Developer 2008 Express and the."

Similar presentations


Ads by Google