Assembling a Three-Tier Web Form Application

Similar documents
INTRODUCTION TO.NET. Domain of.net D.N.A. Architecture One Tier Two Tier Three Tier N-Tier THE COMMON LANGUAGE RUNTIME (C.L.R.)

DOT NET Syllabus (6 Months)

ASP.NET Training Course Duration. 30 Working days, daily one and half hours. ASP.NET Training Course Overview

Chapter 9. Web Applications The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill

M Developing Microsoft ASP.NET Web Applications Using Visual Studio.NET 5 Day Course

ASP.NET 2.0 p. 1.NET Framework 2.0 p. 2 ASP.NET 2.0 p. 4 New Features p. 5 Special Folders Make Integration Easier p. 5 Security p.

2310C VB - Developing Web Applications Using Microsoft Visual Studio 2008 Course Number: 2310C Course Length: 5 Days

Mobile MOUSe ASP.NET FOR DEVELOPERS PART 1 ONLINE COURSE OUTLINE

.NET FRAMEWORK. Visual C#.Net

DOT NET SYLLABUS FOR 6 MONTHS

Course ID: 2310C Course Name: Developing Web Applications Using Microsoft Visual Studio 2008

.NET, C#, and ASP.NET p. 1 What Is.NET? p. 2 The Common Language Runtime p. 2 Introducing C# p. 3 Introducing ASP.NET p. 4 Getting Started p.

Audience: Experienced application developers or architects responsible for Web applications in a Microsoft environment.

C# Programming: From Problem Analysis to Program Design 2nd Edition. David McDonald, Ph.D. Director of Emerging Technologies. Objectives (1 of 2)

Distributed Systems. Web Services (WS) and Service Oriented Architectures (SOA) László Böszörményi Distributed Systems Web Services - 1

ASP.NET Using C# (VS2013)

Traditional Web Based Systems

ASP.NET Web Forms Programming Using Visual Basic.NET

1.1 Customize the Layout and Appearance of a Web Page. 1.2 Understand ASP.NET Intrinsic Objects. 1.3 Understand State Information in Web Applications

10267A CS: Developing Web Applications Using Microsoft Visual Studio 2010

Microsoft ASP.NET Whole Course Syllabus upto Developer Module (Including all three module Primary.NET + Advance Course Techniques+ Developer Tricks)

Developing Web Applications Using Microsoft Visual Studio 2008

Microsoft.NET Programming (C#, ASP.NET,ADO.NET, VB.NET, Crystal Report, Sql Server) Goal: Make the learner proficient in the usage of MS Technologies

.Net Interview Questions

Saikat Banerjee Page 1

.Net. Course Content ASP.NET

Windows Database Applications

Getting Started with the Bullhorn SOAP API and C#/.NET

C#.NET TRAINING / /

Chapter 8 Web Services Objectives

Microsoft ASP.NET Using Visual Basic 2008: Volume 1 Table of Contents

Dreamweaver CS3 Concepts and Techniques

Oracle Developer Day

Chapter 10. Database Applications The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill

The Processing Directives of a Page p. 91 The Page Class p. 99 Properties of the Page Class p. 100 Methods of the Page Class p.

Program Contents: DOTNET TRAINING IN CHENNAI

Web Programming Paper Solution (Chapter wise)

Web Service Elements. Element Specifications for Cisco Unified CVP VXML Server and Cisco Unified Call Studio Release 10.0(1) 1

CETPA INFOTECH PVT. LTD.

COURSE OUTLINE: OD10267A Introduction to Web Development with Microsoft Visual Studio 2010

Web Services in Cincom VisualWorks. WHITE PAPER Cincom In-depth Analysis and Review

Beginning ASP.NET. 4.5 in C# Matthew MacDonald

Configuring Stickiness

EXAM Web Development Fundamentals. Buy Full Product.

DE-2310 Developing Web Applications Using Microsoft Visual Studio 2008 SP1

User Manual. Admin Report Kit for IIS 7 (ARKIIS)

CSC 330 Object-Oriented

Oracle 10g: Build J2EE Applications

5.1 Configuring Authentication, Authorization, and Impersonation. 5.2 Configuring Projects, Solutions, and Reference Assemblies

Cookies, Sessions, and Persistence

Kentico CMS Web Parts

The Design of The Integration System for OTOP Products Data Using Web Services Technology, Thailand

VALLIAMMAI ENGINEERING COLLEGE

Programming with ADO.NET

COPYRIGHTED MATERIAL. Contents. Chapter 1: Introducing Microsoft Expression Web 1. Chapter 2: Building a Web Page 21. Acknowledgments Introduction

AC I Sem 5_TYCS. ASP.NET application codes can be written in any of the following languages:

Browser behavior can be quite complex, using more HTTP features than the basic exchange, this trace will show us how much gets transferred.

J2EE Development. Course Detail: Audience. Duration. Course Abstract. Course Objectives. Course Topics. Class Format.

Session 8. Reading and Reference. en.wikipedia.org/wiki/list_of_http_headers. en.wikipedia.org/wiki/http_status_codes

Introduction to Web Development with Microsoft Visual Studio 2010

Road Map for Essential Studio 2011 Volume 4

.NET-6Weeks Project Based Training

Developing Web Applications Using ASP.NET Duration:56 Hours

Naresh Information Technologies

Kendo UI. Builder by Progress : What's New

SECURED PROGRAMMING IN.NET DETAILED TRAINING CONTENT INDUSTRIAL TRAINING PROGRAM ( )

ALPHAPRIMETECH 112 New South Road, Hicksville, NY 11801

Developing Web Applications Using Microsoft Visual Studio 2008 SP1

PASS4TEST. IT Certification Guaranteed, The Easy Way! We offer free update service for one year

Chapter 3. Windows Database Applications The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill

ArtOfTest Inc. Automation Design Canvas 2.0 Beta Quick-Start Guide

VERSION JANUARY 19, 2015 TEST STUDIO QUICK-START GUIDE STANDALONE & VISUAL STUDIO PLUG-IN TELERIK A PROGRESS COMPANY

Telerik Corp. Test Studio Standalone & Visual Studio Plug-In Quick-Start Guide

"Charting the Course... MOC A Introduction to Web Development with Microsoft Visual Studio Course Summary

Early Data Analyzer Web User Guide

Intellicus Enterprise Reporting and BI Platform

Introduction to Web Development with Microsoft Visual Studio 2010

Lab 5: ASP.NET 2.0 Profiles and Localization

NetAdvantage for ASP.NET Release Notes

DOT NET COURSE BROCHURE

ReCPro TM User Manual Version 1.15


INTRODUCTORY INFORMATION TECHNOLOGY CREATING WEB-ENABLED APPLICATIONS. Faramarz Hendessi

(9A05803) WEB SERVICES (ELECTIVE - III)

Mobile MOUSe ADO.NET FOR DEVELOPERS PART 1 ONLINE COURSE OUTLINE

ITdumpsFree. Get free valid exam dumps and pass your exam test with confidence

Distributed Multitiered Application

Overview of the Adobe Dreamweaver CS5 workspace

File: SiteExecutive 2013 Core Modules User Guide.docx Printed September 30, 2013

Creating Web Applications Using ASP.NET 2.0

XML Web Service? A programmable component Provides a particular function for an application Can be published, located, and invoked across the Web

BEAAquaLogic. Service Bus. JPD Transport User Guide

EMC ApplicationXtender Web Access.NET eroom Integration 6.0

Course Syllabus. Course Title. Who should attend? Course Description. ASP.NET ( Level 1 )

10267 Introduction to Web Development with Microsoft Visual Studio 2010

SOFTRONIICS Call:

HyperText Transfer Protocol

WWW, REST, and Web Services

STARCOUNTER. Technical Overview

IT2353 Web Technology Important Questions 2 Marks and 16 Marks Unit 1 Part A 1. Differentiate Internet with Intranet. 2. What are HTML tags? 3.

Transcription:

Chapter 16 Objectives Assembling a Three-Tier Application In this chapter, you will: Understand the concept of state for Web applications Create an ASP.NET user control Use data binding technology Develop a Web application for Bradshaw Marina Learn about XML and Web services 1 2 Understanding the Concept of State for Web Applications Hypertext Transmission Protocol (HTTP) Used by the Internet A stateless protocol Does not know whether the request is a single request or part of a sequence of requests from the same user Maintaining State Options available in HTTP for maintaining state: Application state Uses the Application object for information that needs to be available to all users on the site Session state Uses the Session object Information persists only for the duration of the session of a particular client 3 4 Maintaining State Understanding Application State and the Application Object Options available in HTTP for maintaining state (continued): Cookies Save small amounts of information, less than 4 K, in a file on the client's computer Information persists for an assigned length of time Database Saves large amounts of information Information persists beyond the session Application object Can be used to save global information that can be shared among all users of a Web application Only one is available for each Web application Application variables in ASP.NET Stored centrally Can be accessed through the Application property of the ASP.NET class Global.asax file Contains the initial application state variable 5 6

Understanding Application State and the Application Object Application variable values are available to all users of the Web site Conflicts can occur if multiple users try to change the same variable s value at the same time Solution Before changing the value of an application variable Invoke the application s Lock method After the change has been made Invoke the application s Unlock method Understanding Session State and the Session Object Session object Provides a way to keep information about a user throughout multiple requests to a Web application A session Begins when the user enters the Web site Ends when the user leaves the Web application or a timeout occurs Default timeout is typically 20 minutes 7 8 Understanding Session State and the Session Object Using Cookies Session data is used in: Shopping cart or basket Web applications Web pages which offer personalization A cookie A small text file saved on the computer by the Web application Provides a way to save state beyond the current visit Often used for keeping User preferences Information for logons 9 10 Using Cookies Using Cookies Browser settings regarding cookies Default: allow the computer to accept cookies Can be changed to prevent cookies from being written to the computer Expiration of a cookie Applications can set an expiration date Otherwise, a cookie expires when the session ends Cookies Written using the response object Retrieved using the request object Can be Single-value Multiple-value 11 12

Using Cookies Using the ASP.NET Session State Control ASP.NET can be configured to work without cookies by using its own session state model In this model ASP.NET server serializes all objects in the session collection to the session state store at the end of each Web request Storage of session state Default settings: The session state store is kept in cached memory Can be configured to store the session state to a database 13 14 Creating an ASP.NET User Control Creating an ASP.NET User Control User controls Web forms that consist of ASP server controls and HTML code without <HTML> tag <HEADER> tag <TITLE> tag A user control file Created within an existing application Has an.ascx extension An example of using user controls A Web application navigation system Can be easily placed in all the Web forms of the Web application 15 16 Creating an ASP.NET User Control Using Data Binding Technology Data binding technology Provides a means to tie the property of a control to an underlying source of data Data bound or data aware controls Controls which are bound to an underlying source of data Do not need to be repopulated when the data changes 17 18

Binding Data to a Drop-Down List Binding Data to a Drop-Down List Boat Manufacturers Web form contains three user controls: A drop-down list box A label A button 19 20 Binding Data to a Drop-Down List Drop-down list box on Boat Manufacturers Web form Initially populated with the names of four boat manufacturers Done using an array list Change Value button Used to change the values in the array list Changes are reflected in the list box ASP.NET data bound only controls Designed for presenting data on Web forms Include Repeater DataList DataGrid 21 22 DataGrid control Like an HTML table that provides enhanced features such as Column sorting Pagination In-grid updating Flexible formatting In the Bradshaw Marina Web site Can be used for the Boat class 23 24

In two-tier applications The data grid is typically bound directly to the data sets of a database In three-tier applications The array list intermediates as the middle tier between the data and the presentation An ASP.NET DataTable control Handles the data and binds the grid to it To create a DataGrid control Create a table Populate the table with data from the boat array list Bind the data grid to this data table Configure the data grid Use the DataGrid Properties dialog box 25 26 DataGrid Properties dialog box can be used to Define the general properties of the grid For example: how data is sorted Set properties of Columns Paging behavior Format of the grid Border of the grid 27 28 29 30

Developing a Web Application for Bradshaw Marina Bradshaw Marina Web site Will be based on a three-tier approach Will use the request/response Web model 31 32 Developing a Web Application for Bradshaw Marina Bradshaw Marina Web Site Design Bradshaw Marina Web site design A user control will provide basic navigation between pages Will use Web server control buttons Bradshaw Marina home page design Home page controls perform most of the processing for the Web site Home page file: default.aspx User control files: theme.ascx and theme.ascx.vb 33 34 Bradshaw Marina Web Site Design Designing the Bradshaw Marina Home Data grid Bound to the customer attributes Name Address Phone number Can be used to update and delete customer information 35 36

Designing the Bradshaw Marina Home Designing the Bradshaw Marina Home When a user successfully logs on to the Web site The Web application writes cookies to save Customer s name Customer s address lblreturning Customer control Holds the name of the customer if he or she returns to the site before the cookies expire 37 38 Designing the Bradshaw Marina Home Designing the Bradshaw Marina Home Drop-down list box Bound to the customer name When the user clicks the name Customer s boat is retrieved Panel to the left of the drop-down list box appears and is populated with the boat attributes of the customer Grid resizes to show only the selected customer 39 40 Designing the Bradshaw Marina Home List All Customers button When clicked Shows all the customers in the data grid Hides the panel showing boat information Add Customer & Boat button Used to navigate to a Web form where a new customer and boat can be added lblnbrusers control Displays the number of times the page has been visited Designing the Bradshaw Marina Home Navigation bar at the top of the Web page A user control Includes four horizontal navigation buttons If the Edit link in a row of the data grid is clicked The form adds text boxes to the name and address columns On the row where Edit was clicked, the words Update and Cancel replace the word Edit 41 42

Designing the Bradshaw Marina Home Examining the Code for the Default _Init event handler Establishes a connection to the database Initializes the connection _Load event handler Checks for postback Loads all the customers into an array list Calls the BindToGrid method Adds to number of site visits Gets customer cookie if it exists Hides the panel control and boat attributes 43 44 Examining the Code for the Default Examining the Code for the Default BindToGrid method Creates a table Populates the table from the array list of customers Binds the table to the data grid ddlnames_selectedindexchanged event handler When a name in the drop-down list box is clicked Searches for the boat for the selected customer Obtains the customer s boat attributes Displays the customer s boat attributes btnallcust_click method Contains the code for the button to have all the customers appear in the data grid btnaddcustboat_click method Redirects program control to the AddCustomerBoat.aspx Web form 45 46 Examining the Code for the Default Examining the Code for the Default Edit and Delete columns of the data grid Can be added using the Property Builder Some code must be added to handle the required processing for Updating Canceling Deleting 47 48

Examining the Code for the Default DataGrid1_Edit method Contains the code for the Edit command Sets the row clicked in the Edit column to the data grid s EditItemIndex property DataGrid1_Update method Contains the code for the update event Obtains values from the data grid Creates a customer instance Calls the Update method of the customer instance Turns off the edit mode Binds the data to the grid Examining the Code for the Default DataGrid1_Cancel method Turns off the edit mode Rebinds the data DataGrid1_Delete method Contains the code for deleting a record Obtains values from the data grid Creates a customer instance Calls the Delete method of the customer instance Rebinds the data to the data grid 49 50 Designing the AddCustomerBoat Web Form AddCustomerBoat Web form Uses Web validation controls to validate data RequiredFieldValidator control Used in each text box to ensure that a value is entered into the text box CompareValidator control Validates entries for» Boat length» Model year» Phone number Designing the AddCustomerBoat Web Form AddCustomerBoat Web form Bottom part of the panel Used to enter boat data Contains two panels Uses a radio button list control with» A Sailboat radio button» A Powerboat radio button Sets the default boat type to sailboat 51 52 Designing the AddCustomerBoat Web Form Designing the AddCustomerBoat Web Form 53 54

Designing the Startup Designing the Startup Login Web form Ensures that data has been entered into the text boxes Uses customer phone number to check whether the person logging on is a customer If the person is a customer An acknowledgment message is displayed If the customer is not found in the customer table A message indicating that the customer could not be found appears 55 56 Designing the AboutBradshawMarina Designing the AboutBradshawMarina Horizontal navigation bar About Bradshaw Marina button Opens the AboutBradshawMarina A static Web page Provides information about Bradshaw Marina Register button Opens a Web form where users can register Not yet implemented 57 58 Introduction to XML and Web Services Introduction to XML and Web Services XML (Extensible Markup Language) provides a way to Integrate disparate data sources within an organization Distribute applications across enterprises via the Internet XML Developed to overcome the following limitations of HTML HTML cannot handle hierarchical structures HTML tags do not relate to the content Web developers are limited to using the existing fixed HTML tag set 59 60

XML Example Application XML Example Application XML can be used with the Bradshaw Marina Web site An example Retrieves customer and boat information from a database Stores the information in a dataset A dataset s WriteXML method Creates an XML file Stores the dataset values in XML format ReadXML method Retrieves the data from an XML file Populates the dataset 61 62 Understanding Web Services Understanding Web Services A Web service Technically The resulting service for any HTTP request Common view A Web service is based on the Internet and XML (essentially XML Web services) A Web service performs a specific functional requirement The.NET framework provides tools for creating Web services Technologies involved in creating Web services Simple Object Access Protocol (SOAP) Web Services Description Language (WSDL) Universal Description, Integration, and Discovery (UDDI) 63 64 Understanding Web Services Understanding Web Services Simple Object Access Protocol (SOAP) A messaging protocol Provides a way to wrap information required to be sent with a request to a Web service Serves as a wrapper for the information returned from the Web service Web Services Description Language (WSDL) Defines all of the interactions of a Web service regardless of the computing platform on which the Web service is running Universal Description, Integration, and Discovery (UDDI) Provides a mechanism for discovering available Web services 65 66

Developing a Web Service for Bradshaw Marina A Web service developed for Bradshaw Marina Determines the rental charges for its slips Logic Rental charges are based on the length of the boat for a dock Boats up to 30 feet in length can use a standard dock with a monthly rental fee of three dollars per foot Boats longer than 30 feet require a special dock and rent for five dollars per foot, starting at 30 feet No boats over 50 feet can be docked Can be used by other marinas with the same logic for rentals Summary HTTP is a stateless protocol Application state, Session state, and cookies assist in maintaining state between the client and the server Both two tier and three tier Web processing relies on the request/response model ASP.NET user controls provide consistency to Web forms ASP.NET s data binding technology allows properties of Web server controls to be bound to an underlying data source 67 68 Summary XML, a self-describing data formatting technology, provides a text-based data storage format that supports hierarchical data structures Web services distribute logic over the Internet SOAP provides wrappers around structures sent to a Web service and returned from a Web service WSDL is a platform-independent standard for describing data for Web services UDDI assists in locating and using Web services 69