Tài liệu Module 4: Designing the Client Experience - Pdf 84

Contents
Overview 1
Presentation Tier Architecture 2
Overview of ASP.NET 12
ASP.NET Server Controls 19
ASP.NET Web Controls 25
Lab 4: Controlling the Presentation Tier
with ASP.NET 43
Review 51

Module 4: Designing the
Client Experience

Information in this document is subject to change without notice. The names of companies,
products, people, characters, and/or data mentioned herein are fictitious and are in no way intended
to represent any real individual, company, product, or event, unless otherwise noted. Complying
with all applicable copyright laws is the responsibility of the user. No part of this document may
be reproduced or transmitted in any form or by any means, electronic or mechanical, for any
purpose, without the express written permission of Microsoft Corporation. If, however, your only
means of access is electronic, permission to print one copy is hereby granted.

Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual
property rights covering subject matter in this document. Except as expressly provided in any
written license agreement from Microsoft, the furnishing of this document does not give you any
license to these patents, trademarks, copyrights, or other intellectual property.

Explain the ASP.NET object model.

Describe the features of ASP.NET.

Describe how ASP.NET server controls and Web controls simplify client
development.

Materials and Preparation
This section provides the materials and preparation tasks that you need to teach
this module.
Required Materials
To teach this module, you need the following materials:

Microsoft PowerPoint
®
file 2260A_04.ppt

Module 4, “Designing the Client Experience”

Lab 4, “Controlling the Presentation Tier with ASP.NET”

Animation “ASP.NET Execution Model” in file 2260A_04A005.exe

Preparation Tasks
To prepare for this module, you should:

Read all of the materials for this module.

Complete the lab.


compiler is invoked.
The compiler loads the page and compiles the code into
Microsoft intermediate language (MSIL).
The compiled MSIL code is used for returning the
requested page to the client.
Click Second Request When the client requests the same page the second time,
the server again checks for an existing output cache or
the compiled code.
If the server finds the compiled code, notice how the
compiler step is omitted and the compiled code is used
immediately for returning the request.
Click Output Cache This is the other case, when the server finds the requested
page in the output cache. In this case, notice how all of
the other steps are bypassed and the requested page is
directly returned from the output cache.

Module 4: Designing the Client Experience v

Module Strategy
Use the following strategy to present this module:

Presentation Tier Architecture
Discuss the technologies that can be used to create the presentation tier and
the requirements for a well-designed client experience.
Do not go into any more detail than what is covered in the section because
various technologies are expanded in the rest of the sections in this module.

Overview of ASP.NET
Provide an overview of ASP.NET in terms of its role in the .NET
Framework, execution model, and new features.

Presentation Tier Architecture

Overview of ASP.NET

ASP.NET Server Controls

ASP.NET Web Controls

*****************************I
LLEGAL FOR
N
ON
-T
RAINER
U
SE
*****************************
This module describes the key issues associated with the design and
development of the presentation tier of an e-business Web site. In this module,
special emphasis is placed on Microsoft
®
ASP.NET technology and how it can
be used to simplify the development of the presentation tier.
After completing this module, you will be able to:

Identify the requirements of a well-designed presentation tier from the
user’s perspective.

Explain the ASP.NET object model.



Using Forms

*****************************I
LLEGAL FOR
N
ON
-T
RAINER
U
SE
*****************************
To design the presentation tier of an e-business application, you must know the
requirements of the presentation tier and the technologies that can be used to
create the presentation tier. Also, you must be able to address all of the
architectural issues that are involved in delivering the usability, performance,
and scalability that is expected in a professional e-business Web site.
This section focuses on the requirements of a well-designed presentation tier
that can enrich the user’s experience.
Topic Objective
To describe the
presentation-tier
components and design
requirements.
Lead-in
In this section, you will learn
about the requirements of a
well-designed presentation
tier that can enrich the
user’s experience.


Version 4
Version 4 browsers include Microsoft Internet Explorer 4.0 and Netscape
Navigator 4.5 and 4.7. These browsers support client-side scripting and
Dynamic HTML (DHTML).

Versions 5 and 6
Version 5 and 6 browsers include Microsoft Internet Explorer 5 and 5.5 and
Netscape Navigator 6. These browsers have Extensible Markup Language
(XML) support.

Topic Objective
To describe the
technologies available to the
developer of the
presentation tier.
Lead-in
The presentation tier
consists of various
technologies.
4 Module 4: Designing the Client Experience

HTML
The Web browser is responsible for rendering HTML. A basic Web page starts
with an <HTML> tag and ends with a corresponding </HTML> close tag.
Within these tags are additional tags that are nested to produce the final
document. The browser translates these tags into what is shown when the page
is displayed to the user. Recent browser versions that have support for XML
enable client-side script to process the data intelligently at the client, without
requiring a round-trip to the server. You can write client-side scripts to filter an

ASP/ASP.NET Pages
Active Server Pages (ASP) are Web pages that contain scripting elements
that are run on the server. Common tasks for ASP pages are retrieving data
from a database and generating subsequent HTML or XML pages.
ASP.NET offers several improvements over ASP. ASP.NET is discussed in
the following sections of this module.

COM objects
Applications that are running on IIS can call Component Object Model
(COM) objects that have been written in more powerful languages, such as
Microsoft Visual Basic
®
and Visual C++. COM objects allow for the
encapsulation of programming logic and allow the calling application to
concentrate on invoking the correct method, properties, or events, without
requiring an understanding of how the object works internally.

Module 4: Designing the Client Experience 5

HTTP
HTTP is a communication protocol designed to transfer hypertext documents
between computers over the World Wide Web (WWW). HTTP defines a set of
commands and responses that browsers and servers use to complete various
tasks. By intercepting the HTTP request on the server, Web applications can
build dynamic responses to the user’s request.
6 Module 4: Designing the Client Experience

Architectural Requirements

State

maintenance of state and some, such as cookies, require support on the client.
You will learn about state management in detail in Module 5, “Managing the
Business Logic Layer,” in Course 2260A, Designing E-Business Applications
with Microsoft .NET Enterprise Servers.
Validation
As users fill in forms and submit information to the site, mechanisms must be
put in place to recognize if the user has filled in all of the required fields.
Certain validation could take place on the client. For example, if a user leaves a
field blank, the client could inform them before sending the data back to the
server. This is an architectural decision made by the developer.
Scalability
Another important issue in the design of a solution is the ability for the solution
to scale. This means the solution needs to be able to cope with additional
demands made by extra users. With an increase in the number of users, more
processing power will be required. This additional processing can be
implemented either by adding more CPUs to the existing machine or by adding
additional servers. A solution that has been scaled out by adding more servers is
termed a Web farm, and a solution that has been scaled up by adding more
CPUs to a single server creates a Web garden.
Topic Objective
To explain the technical
requirements that must be
considered when designing
the site architecture.
Lead-in
When designing the site
architecture, there are
technical requirements that
must be considered.
Module 4: Designing the Client Experience 7

• Given the number of users that are anticipated, how will the site
perform?
• If the number of visitors has been underestimated, what plans have been
prepared to expand the site?
This is a scalability issue.

How many servers will be needed to support the users without service
interruption?
• Will the user simply browse to a competitor and buy from them?
• Is the product available from only this site, in which case will they try
later?
• If the customer goes to a competitor’s site, have you lost one sale or
have you destroyed the relationship and lost all future sales?
This point concentrates mainly on the availability of the site. The cost
associated with a site being unavailable is hard to quantify.

How many transactions will take place on the site?
Apart from the expected number of users of your site, the number of
transactions will also have an impact on the design of the e-business
solution.

What are the peaks and dips during site activity?
Unfortunately, the site’s users do not spread their visits evenly throughout
the day. The site may have usage peaks, and it is critical that, when those
peaks occur, the site can cope with the traffic.
Topic Objective
To explain the factors that
impact the site design.
Lead-in
Consider the following

Reverse caching

Distributed caching

*****************************I
LLEGAL FOR
N
ON
-T
RAINER
U
SE
*****************************
You can improve the performance of the presentation tier in an e-business
solution by implementing a cache.
The Caching Process
Caching improves network performance by maintaining a store of frequently
accessed Web objects. As a user requests an object from a Web server, the
cache is checked. If the object can be supplied from the cache, the request is
serviced without impacting the Web server. If the request cannot be serviced
from the cache, the request is passed to the Web server. The Web server’s
response is returned to the browser and added to the cache for subsequent
requests.
ISA Server Caching Solutions
Microsoft Internet Security and Acceleration (ISA) Server 2000, a part of the
Microsoft .NET Enterprise Server family, offers an integrated caching and
security solution. It enables you to implement any of the following caching
solutions:

Forward caching

distributed. The security features of the ISA Server are covered in Module 7,
“Integrating with External Systems,” in Course 2260A, Designing E-Business
Applications with Microsoft .NET Enterprise Servers. Further information about
the ISA Server is available in Course 2159A, Deploying and Managing
Microsoft Internet Security and Acceleration Server 2000.

Note
Module 4: Designing the Client Experience 11

Using Forms

Used to Receive User Input

Preserving User Input After Form Data Has Been Posted
to the Server Is Critical to Forms

ASP Forms

Write significant code to preserve user input after a post

ASP.NET Web Forms

Maintenance of state has been made easier

*****************************I
LLEGAL FOR
N

Topic Objective
To describe the importance
of retrieving data from the
user.
Lead-in
There are several ways of
retrieving information from
users when they visit your
site. Forms are one
standard approach.
12 Module 4: Designing the Client Experience





Overview of ASP.NET

The ASP.NET Execution Model

Multimedia: The ASP.NET Execution Model

ASP.NET Features

*****************************I
LLEGAL FOR
N
ON
-T
RAINER

code-behind pages
(View mod4ex1.aspx and
codebehind.vb from Sampapps)

*****************************I
LLEGAL FOR
N
ON
-T
RAINER
U
SE
*****************************
One of the biggest challenges facing developers is ensuring that the code they
write works consistently with different browsers. ASP provides a solution by
allowing the developer to write code that runs on the server. Implementation of
this solution has been successful because it allows the developer to write code
that will execute in a known environment on the server instead of having to
develop two or three different versions of code that run at the client on different
browsers. However, to handle relatively simple requirements, such as
preserving the options a user has selected in a form, the developers have to
intersperse client-side HTML and server-side code in the .asp file. This leads to
complexity of code because there is no clear separation of the server-side code
and the client-side HTML in the .asp file.
ASP.NET builds on the foundation provided by ASP and at the same time
simplifies development. For example, ASP.NET can automatically determine
the capabilities of the browser and where it is supported and can delegate
subsequent work—such as stepping through a calendar or validating an input
box—back down to the client.
ASP.NET also allows for the separation of code from the HTML tags in an

Multimedia: The ASP.NET Execution Model

*****************************I
LLEGAL FOR
N
ON
-T
RAINER
U
SE
*****************************
To see an animation on how ASP.NET pages are processed on the server, run
the ASP.NET Execution Model media element on the Student Materials
compact disc.
The following graphic illustrates the ASP.NET Execution model:

Topic Objective
To describe the ASP.NET
execution model.
Lead-in
In this animation, you will
see how ASP.NET pages
are processed on the
server.

Delivery Tips
Play the animation
2260A_04A005.exe on the
Student Materials compact
disc.

When you request an ASP.NET file for the first time:
1. The code is compiled into Microsoft intermediate language (MSIL), which
is a CPU-independent set of instructions.
2. The MSIL code is converted to native code by the Just In Time (JIT)
compiler, which is part of the Microsoft .NET Framework.
3. The native code is executed.

This results in a greatly increased performance because after the first request,
the code can run for subsequent requests from the much faster compiled
version.
Multiple Language Support
ASP.NET provides a true language-neutral execution framework for Web
applications. Regardless of the language used in the ASP.NET page, the MSIL
code generated will be identical; thereby leaving the developer free to choose
the language he or she is most comfortable with. This includes fully compiled
languages, such as Visual Basic and Visual C++, in addition to a new Microsoft
language called Microsoft C#

. Several companies are producing compilers
that are targeting the Common Language Runtime, which is part of the .NET
Framework.
Topic Objective
To describe some of the key
features of ASP.NET.
Lead-in
ASP.NET includes many
useful features for Web
development.
16 Module 4: Designing the Client Experience



*****************************I
LLEGAL FOR
N
ON
-T
RAINER
U
SE
*****************************
Here are a few more important features of ASP.NET that ease the development
and maintenance of Web applications.
Improved Security
ASP.NET implements a range of different authentication mechanisms: Basic,
Digest, Windows, Passport, and cookie. After a user has been authenticated,
access can be granted by comparing authenticated details to NT file system
(NTFS) permissions or by comparing credentials to an XML configuration file.
The XML credentials are stored in a file called config.web.
In addition, creating forms-based authentication, in which you can have your
own custom logon screen and credential checking, is much easier when you are
using ASP.NET.
Caching
Caching is an extremely important technique for building high-performance,
scalable Web server applications.
ASP.NET offers a number of caching mechanisms that enhance Web
application performance. For example, all ASP.NET pages are compiled and
cached on the server. They are updated in the cache only when the page
changes or the caching period expires.
Application State and Session State Management
In ASP.NET, application state and session state management is extended to

on a separate machine, or even in a database, thereby allowing for sessions that
can be accessed from multiple Web servers. This allows you to add more Web
servers as your site traffic grows.
In addition, ASP.NET includes support for Web gardens. This helps make
multi-processor machines scale so that they can do more work than single
processor machines.
Easy Configuration and Deployment
Configuration and deployment is now easier with the use of human-readable
XML-format configuration files.
In ASP.NET, all of the configuration details for Web applications are kept in
XML files named config.web. These files are stored in the folders on the Web
server and are applied hierarchically. This means a single Web application can
have multiple configuration files for different parts of the application.
By using ASP.NET, applications can be deployed by using file copy
commands, Microsoft FrontPage
®
server extensions (FPSE), or File Transfer
Protocol (FTP).
Note
Module 4: Designing the Client Experience 19





ASP.NET Server Controls

Features of Server Controls

Server-programmable objects

Web controls

Both types of controls can be created and accessed on the server. Both also
provide a rich set of services to build your own interactive pages.
For example, Web form controls can also detect the browser that is hitting a
form and return the appropriate content: HTML 3.2 for earlier versions of
browsers or DHTML for Internet Explorer 5 or later.
Server controls also provide an easy mechanism for preserving the state of
forms that are submitted to the server.
Topic Objective
To explain how ASP.NET
controls can ease the
development of the
presentation layer.
Lead-in
ASP.NET offers a new
feature called server
controls.


Nhờ tải bản gốc

Tài liệu, ebook tham khảo khác

Music ♫

Copyright: Tài liệu đại học © DMCA.com Protection Status