Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
NET
Objectives
Ver. 1.0
Slide 1 of 26
Problem Statement:
You are a developer in the Adventure Works organization, a
fictitious bicycle manufacturer. You have been asked to assist
in the development of the Business-to-Consumer (B2C) Web
application and a related Business-to-Employee (B2E) extranet
portal.
Decisions on the design of the application have already been
made. As part of the first phase of the B2C development, you
have been asked to configure the behavior of Web server
controls by manipulating their ViewState properties. You have
also been asked to add a site-counter to the site, which will
display user numbers and store data in the Application and
Session objects.
Ver. 1.0
Slide 2 of 26
You will also specify how the Web application stores and
manages session state data. Finally, you have been asked to
implement caching by using the Cache object to store bike
review data.
Ver. 1.0
Slide 3 of 26
Solution:
To solve this problem, you need to perform the following tasks:
1. Configuring ViewState Properties for Web Server Controls
a.
b.
c.
d.
e.
Ver. 1.0
Slide 4 of 26
Ver. 1.0
Slide 5 of 26
Ver. 1.0
Slide 6 of 26
Ver. 1.0
Slide 7 of 26
Ver. 1.0
Slide 8 of 26
Ver. 1.0
Slide 9 of 26
Ver. 1.0
Slide 10 of 26
Ver. 1.0
Slide 11 of 26
Ver. 1.0
Slide 12 of 26
Providers:
A provider is a class that can communicate with a specific type
of database or data store.
ASP.NET provides a number of providers that can
communicate with a wide variety of data stores.
The providers include, the .NET framework data provider for:
SQL server in the System.Data.SqlClient namespace
OLE DB in the System.Data.OleDb namespace
ODBC in the System.Data.Odbc namespace
Oracle in the System.Data.OracleClient namespace
Ver. 1.0
Slide 13 of 26
DataSet:
Allows users to manipulate data after retrieving it.
Is used when a user want to filter, sort, or page through data after
retrieving it.
Data reader:
Provides a read-only cursor that can fetch individual records.
Is used to return and load the data into a control on the page.
Ver. 1.0
Slide 14 of 26
Caching:
The SqlDataSource control can cache data that it has
retrieved.
Caching can be enabled by setting EnableCaching to
true.
CacheDuration property can be set to specify the number
of seconds to cache data.
Cache dependency feature of SQL Server can also be used
by SqlDataSource control.
By using cache dependency, retrieval of data can be
minimized.
Ver. 1.0
Slide 15 of 26
Ver. 1.0
Slide 16 of 26
Ver. 1.0
Slide 17 of 26
Slide 18 of 26
Ver. 1.0
Slide 19 of 26
Ver. 1.0
Slide 20 of 26
Ver. 1.0
Slide 21 of 26
Ver. 1.0
Slide 22 of 26
Ver. 1.0
Slide 23 of 26
Ver. 1.0
Slide 24 of 26
Ver. 1.0
Slide 25 of 26
Ver. 1.0
Slide 26 of 26