Walther, Stephen

ASP. NET 2.0: Unleashed - 3rd Impression - New Delhi: Pearson Education, 2007. - 1962p.

Table of Contents

Introduction

Part 1 Building ASP.NET Pages

1

Overview of the ASP.NET Framework

ASP.NET and the .NET Framework

Understanding the Framework Class Library

Understanding the Common Language Runtime

Understanding ASP.NET Controls Overview of ASP.NET Controls. Understanding HTML Controls Understanding and Handling Control Events Understanding View State Understanding Control Trees Using Code-Behind Pages Handling Page Events Using the Page. IsPostBack Property Debugging and Tracing ASP.NET Pages Tracing Page Execution

Understanding ASP.NET Pages

Understanding Dynamic Compilation

Installing the ASP.NET Framework

Summary

2 Using the Standard Controls

Displaying Information

Using the Label Control

Using the Literal Control

Accepting User Input

Using the TextBox Control

Using the CheckBox Control

Using the RadioButton Control

Submitting Form Data

Using the Button Control

Using the LinkButton Control

Using the ImageButton Control

Using Client Scripts with Button Controls
ASP.NET 2.0 Unleashed

Performing Cross-Page Posts

Specifying a Default Button

Handling the Command Event

Displaying Images

Using the Image Control

Using the ImageMap Control

Using the Panel Control

Using the HyperLink Control

Summary

3 Using the Validation Controls

Overview of the Validation Controls

Validation Controls and JavaScript

Using Page. IsValid

Setting the Display Property

Highlighting Validation Errors

Using Validation Groups

Disabling Validation

Using the RequiredFieldValidator Control

Using the RangeValidator Control

Using the CompareValidator Control

Using the CustomValidator Control

Using the Regular ExpressionValidator Control

Using the ValidationSummary Control

Creating Custom Validation Controls

Creating a LengthValidator Control

Creating an AjaxValidator Control

Summary

4 Using the Rich Controls

Motino

Accepting File Uploads

Saving Files to the File System

Saving Files to a Database

Uploading Large Files

Displaying a Calendar

Creating a Pop-up Date Picker

Rendering a Calendar from a Database Table

Displaying Advertisements

Storing Advertisements in an XML File

Tracking Impressions and Transfers

Storing Advertisements in a Database Table
Displaying Different Page Views

Displaying a Tabbed Page View

Displaying a Multi-Part Form

Displaying a Wizard

Summary

Part II Designing ASP.NET Websites

5 Designing Websites with Master Pages

Creating Master Pages

Creating Default Content

Nesting Master Pages

Using Images and Hyperlinks in Master Pages

Registering Master Pages in Web Configuration

Modifying Master Page Content

Using the Title Attribute

Using the Page Header Property

Exposing Master Page Properties

Using FindControl with Master Pages

Loading Master Pages Dynamically

Loading Master Pages Dynamically for Multiple Content Pages

Summary

6 Designing Websites with Themes

Creating Themes

Adding Skins to Themes

Creating Named Skins

Themes versus StyleSheet Themes

Disabling Themes

Registering Themes in the Web Configuration File

Adding Cascading Style Sheets to Themes

Adding Multiple Cascading Style Sheets to a Theme

Changing Page Layouts with Cascading Style Sheets

Creating Global Themes

Applying Themes Dynamically

Applying Skins Dynamically

Summary

7 Creating Custom Controls with User Controls

Creating User Controls

Registering User Controls in the Web Configuration File

Exposing Properties from a User Control

Exposing Events from a User Control

Creating an AddressForm Control

AJAX and User Controls

Dynamically Loading User Controls

Using the Reference Directive

Summary

Creating a Multi-Page Wizard

Part III

Performing Data Access

8 Overview of Data Access

Using DataBound Controls

Working with List Controls

Working with Tabular DataBound Controls

Working with Other Controls.

Working with Hierarchical DataBound Controls

Using DataSource Controls

Using ASP.NET Parameters with DataSource Controls

Using Programmatic DataBinding

Understanding Templates and DataBinding Expressions

Using Templates

Using DataBinding Expressions

Using Two-Way DataBinding Expressions

Overview of SQL Server 2005 Express

Features of SQL Server Express

SQL Server 2005 Express Management Tools

Server Databases versus Local Databasesalchsel

Sample Database-Driven Web Application

Summary

9 Using the SqlDataSource Control

Creating Database Connections

Connecting to Microsoft SQL Server

Connecting to Other Databases

Storing Connection Strings in the Web Configuration File

Encrypting Connection Strings

Executing Database Commands

Executing Inline SQL Statements

Executing Stored Procedures

Filtering Database Rows

Changing the Data Source Mode
Handling SQL. Command Execution Errors

Canceling Command Execution

Using ASP.NET Parameters with the SqlDatasource Control

Using the ASP.NET Parameter Object

Using the ASP.NET ControlParameter Object

Using the ASP.NET CookieParameter Object

Using the ASP.NET FormParameter Object

Using the ASP.NET ProfileParameter Object

Using the QueryStringParameter Object

Using the SessionParameter Object

Programmatically Executing SqlDataSource Commands

Adding ADO.NET Parameters

Executing Insert, Update, and Delete Commands

Executing Select Commands

Caching Database Data with the SqlDataSource Control

Summary

10 Using List Controls

Overview of the List Controls

Declaring List Items

Binding to a Data Source

Determining the Selected List Item

Appending Data Items

Enabling Automatic PostBacks

Using the Items Collection

Working with the DropDownList Control

Working with the RadioButtonList Control

Working with the ListBox Control

Working with the CheckBoxList Control

Working with the BulletedList Control

Creating a Custom List Control

Summary

11 Using the GridView Control

GridView Control Fundamentals

Displaying Data

Selecting Data

Using Data Keys

Sorting Data

Paging Through Data

Editing Data
ASP.NET 2.0 Unleashed

Displaying Empty Data

Formatting the GridView Control

Using View State with the GridView Control

Using Fields with the GridView Control

Using BoundFields

Using CheckBoxFields

Using CommandFields

Using Button Fields

Using HyperLinkField

Using ImageField

Using TemplateField

Working with GridView Control Events

Highlighting GridView Rows

Displaying Column Summaries

Displaying Nested Master/Details Forms.

Extending the GridView Control

Creating a Long Text Field

Creating a Delete Button Field

Summary

Creating a Validated Field

12 Using the DetailsView and FormView Controls

Using the Detailsview Control

Displaying Data with the DetailsView Control.

Using Fields with the DetailsView Control

Displaying Empty Data with the DetailsView Control

Paging through Data with the DetailsView Control.........

Updating Data with the DetailsView Control

Inserting Data with the DetailsView Control

Deleting Data with the DetailsView Control

Working with DetailsView Control Events

Formatting the DetailsView Control

Using the FormView Control

Displaying Data with the FormView Control

Paging Through Data with the FormView Control

Editing Data with the FormView Control

Inserting Data with the FormView Control

Deleting Data with the FormView Control

Summary
13 Using the Repeater and DataList Controls

Using the Repeater Control

Displaying Data with the Repeater Control

Using Templates with the Repeater Control

Handling Repeater Control Events

Using the DataList Control

Displaying Data with the DataList Control

Displaying Data in Multiple Columns

Using Templates with the DataList Control

Selecting Data with the DataList Control

Editing Data with the DataList Control

Formatting the DataList Control

Summary

Part IV Building Components

14 Building Components

Building Basic Components

Components and Dynamic Compilation

Mixing Different Language Components in the App_Code Folder

Declaring Methods.

Declaring Fields and Properties

Declaring Constructors

Overloading Methods and Constructors

Declaring Namespaces

Creating Partial Classes

Inheritance and MustInherit Classes

Declaring Interfaces

Using Access Modifiers

Intellisense and Components

Using ASP.NET Intrinsics in a Component

Building Component Libraries

Compiling Component Libraries

Adding a Reference to a Class Library

Architectural Considerations

Building Multi-tier Applications

Creating the User Interface Layer

Creating the Business Logic Layer

Creating the Data Access Layer

Summary......
ASP.NET 2.0 Unleashed

19 Advanced Navigation

Remapping URLs

Creating a Custom Ur1Remapper Module Using

the VirtualPathProvider Class

Limitations of the VirtualPathProvider Class Understanding the VirtualPathProvider Class

Registering a VirtualPathProvider Class

Storing a Website in Microsoft SQL Server

Summary

Part VI Security

20 Using the Login Controls

Overview of the Login Controls

Using the Login Control

Automatically Redirecting a User to the Referring Page Automatically Hiding the Login Control from

Authenticated Users

Using a Template with the Login Control

Performing Custom Authentication with the Login Control

Using the CreateUserWizard Control

Configuring Create User Form Fields

Automatically Redirecting a User to the Referring Page

Sending a Create User Email Message

Automatically Generating a Password

Using Templates with the CreateUserWizard Control.

Using the LoginStatus Control......

Adding Steps to the CreateUserWizard Control

Using the LoginName Control.

Using the ChangePassword Control

Sending a Change Password Email

Using Templates with the ChangePassword Control

Using the Password Recovery Control

Sending the Original Password

Using Templates with the Password Recovery Control

Requiring a Security Question and Answer

Using the LoginView Control

Using Roles with the LoginView Control

Summary
21

Using ASP.NET Membership

Configuring Authentication

Configuring Forms Authentication

Using Sliding Expiration with Forms Authentication

Using Cookieless Forms Authentication

Using Forms Authentication Across Applications

Using Forms Authentication Across Domains.

Using the FormsAuthentication Class

Using the User Class

Configuring Authorization

Authorizing by Role

Authorizing Files by Location

Using Authorization with Images and Other File Types

Using Authorization with ASP Classic Pages

Using ASP.NET Membership

Using the Membership Application Programming Interface

Encrypting and Hashing User Passwords

Modifying User Password Requirements.

Locking Out Bad Users.

Configuring the SQLMembershipProvider

Configuring the ActiveDirectoryMembership Provider.

Creating a Custom Membership Provider

Using the Role Manager.

Configuring the SqlRoleProvider.

Configuring the Windows TokenRoleProvider..

Configuring the AuthorizationStoreRoleProvider

Caching Roles in a Browser Cookie

Using the Roles Application Programming Interface

Summary

Part VII

Building ASP.NET Applications

22

Maintaining Application State

Using Browser Cookies

Cookie Security Restrictions.

Creating Cookies

Reading Cookies

Setting Cookie Properties

Deleting Cookies.

Working with Multi-Valued Cookies.
Using Session State

Storing Database Data in Session State.

Using the Session Object

Handling Session Events

Controlling When a Session Times Out

Using Cookieless Session State

Configuring a Session State Store

Configuring SQL Server Session State

Creating Profile Groups

Using Profiles

Supporting Anonymous Users

Migrating Anonymous Profiles

Inheriting a Profile from a Custom Class

Creating Complex Profile Properties

Saving Profiles Automatically

Accessing Profiles from Components

Using the Profile Manager

Configuring the Profile Provider

Creating a Custom Profile Provider

Summary

23 Caching Application Pages and Data

Overview of Caching

Using Page Output Caching

Varying the Output Cache by Parameter.

Varying the Output Cache by Control

Varying the Output Cache by Header

Varying the Output Cache by Browser

Varying the Output Cache by a Custom Function

Specifying the Cache Location

Creating a Page Output Cache File Dependency

Expiring the Page Output Cache Programmatically

Manipulating the Page Output Cache Programmatically

Using Partial Page Caching

Creating Page Output Cache Profiles

Using Post-Cache Substitution

Caching with a User Control

Sharing a User Control Output Cache

Manipulating a User Control Cache Programmatically

Creating a User Control Cache File Dependency

Caching Dynamically Loaded User Controls
Using DataSource Caching

Using an Absolute Cache Expiration Policy

Using a Sliding Cache Expiration Policy

Caching with the ObjectDataSource Control

Caching with the xmlDataSource Control

Creating a DataSource Control Key Dependency

Using Data Caching

Using the Cache Application Programming Interface

Adding Items to the Cache

Adding Items with an Absolute Expiration Policy

Adding Items with a Sliding Expiration Policy

Adding Items with Dependencies

Specifying Cache Item Priorities

Configuring the Cache

Using SQL Cache Dependencies

Using Polling SQL Cache Dependencies

Configuring Polling SQL Cache Dependencies

Using Polling SQL Cache Dependencies with Page Output Caching

Using Polling SQL Cache Dependencies with DataSource Caching

Using Polling SQL Cache Dependencies with Data Caching

Using Push SQL Cache Dependencies

Configuring Push SQL Cache Dependencies

Using Push SQL Cache Dependencies with Page Output Caching

Using Push SQL Cache Dependencies with DataSource Caching

Using Push SQL Cache Dependencies with Data Caching Summary

24 Localizing Applications for Multiple Languages

Setting the Current Culture

Automatically Detecting a Culture

Setting a Culture Manually Culture and ASP.NET Controls

Setting the Culture in the Web Configuration File

Using the CultureInfo Class

Using the CultureInfo Class to Format String Values

Comparing and Sorting String Values
Creating Local Resources

Implicit Localization Expressions

Explicit Localization Expressions

Using Local Resources with Page Properties

Retrieving Local Resources Programmatically

Creating Global Resources

Retrieving Global Resources Programmatically

Using the Localize Control

Using Strongly Typed Localization Expressions

Summary

25 Working with the HTTP Runtime

Creating a Custom BuildProvider

Creating a Simple BuildProvider

Creating a Data Access Component BuildProvider

Creating a Custom ExpressionBuilder

Creating a Lookup ExpressionBuilder

Creating HTTP Handlers

Creating a Generic Handler

Implementing the IHttpHandler Interface.

Registering Extensions with Internet Information Server.

Creating an Asynchronous HTTP Handler

Working with HTTP Applications and HTTP Modules

Creating a Global.asax File

Creating Custom HTTP Modules

Summary

26 Configuring Applications

Overview of Website Configuration

Using the Web Site Administration Tool

Using the ASP.NET Microsoft Management Console Snap-In

ASP.NET Configuration Sections

Applying Configuration Settings to a Particular Path

Locking Configuration Settings

Adding Custom Application Settings.

Placing Configuration Settings in an External File

Using the Configuration API

Reading Configuration Sections from the Current Application

Opening a Configuration File

Opening a Configuration File on a Remote Server

Using the Configuration Class
Modifying Configuration Sections

Provisioning a New Website

Creating Custom Configuration Sections

Creating a Configuration Element Collection

Creating Encrypted Configuration Sections

Encrypting Sections with the aspnet_regiis tool

Encrypting Sections Programmatically

Deploying Encrypted Web Configuration Files

Summary

Part VIII

Building Applications with Web Parts

27 Introduction to Web Parts

Overview of the Web Part Framework

Web Part Zones

Web Part Display Modes

Web Part Personalization.

Creating a Simple Web Part Application

Using Catalog Zones

Using a Declarative Catalog Part.

Using a Page Catalog Part

Using the Import Catalog Part

Using Editor Zones.

Using the Appearance Editor Part

Using the Behavior Editor Part

Using the Layout Editor Part..

Using the Property Grid Editor.

Using Connections Zones

Connecting Web Parts

Connecting Simple Web Parts

Connecting Databound Web Parts

Dynamically Connecting Web Parts

Using Transformers with Connected Web Parts

Summary

28

Building Web Parts

Creating Simple Web Parts

The Hello World Web Part

Standard Web Part Properties

Creating a User Control Web Part Base Class

Using Extended Web Part Properties.
MAT

0841

ASP.NET 2.0 Unleashed

Filtering Web Parts

Filtering by Authorization Filter

Filtering by User Control Path

Filtering by Custom Control Type

Creating Custom Web Part Verbs

Creating Server-Side Verbs

Creating Client-Side Verbs

Creating Zone Verbs

Managing Web Parts with the WebPartManager Control

Summary

Displaying Web Part Help

29 Personalizing Web Parts

Overview of Personalization

Using the WebPartPersonalization Class

Creating a Personalization Manager

Configuring Personalization

Configuring User and Shared Scope Personalization

Configuring the Personalization Database

Creating Personalizable Web Parts

Working with Complex Personalizable Properties

Using the IPersonalizable Interface

Administrating Personalization

Creating Custom Personalization Providers

Building a Query String Personalization Provider

Summary

Building an Anonymous Personalization Provider

30 Extending the Web Part Framework

Creating Custom Web Part Zones

How Web Part Zones Work

Creating a Photo Web Part Zone

Creating a Multi-Column Web Part Zone

Creating a Menu Web Part Zone

Creating Custom Catalog Zones

How Catalog Zones Work

Creating a Reflection Catalog Part

Creating a Drag-and-Drop Catalog Zone

Creating Custom Editor Zones

Creating a Templated Catalog Zone

How Editor Zones Work
Creating a Simple Custom Editor Part

Creating a Templated Editor Part

Creating Custom Web Part Display Modes

Summary

Part IX

Custom Control Building

31 Building Custom Controls

Overview of Custom Control Building

Building Fully Rendered Controls

Building Composite Controls

Building Hybrid Controls

View State and Control State

Supporting View State

Supporting Control State

Processing Postback Data and Events

Handling Postback Data

Handling Postback Events

Working with Control Property Collections

Using the ParseChildren Attribute

Using the AddParsedSub0bject Method

Using a ControlBuilder

Creating a Better Designer Experience

Applying Design-Time Attributes to a Control

Creating Control Designers

Creating a Container ControlDesigner

Adding Smart Tasks

Summary

32 Integrating JavaScript in Custom Controls

Using the ClientScriptManager Class

Detecting Browser Capabilities

Building JavaScript Controls

Building a NewWindowLink Control

Building a WebWindow Control

Building a ClientTabs Control

Building AJAX Controls

Implementing AJAX

Building a ServerTimeButton Control

Building an AJAX Combobox Control

Summary
33 Building Templated Databound Controls

Creating Templated Controls.

Implementing the ITemplate Interface

Creating a Default Template

Supporting Simplified Databinding

Supporting Two-Way Databinding

Creating Templated Databound Controls.

Creating a Divview Control

Creating an AjaxDivView Control

Summary

Creating an AjaxFormView Control.

Part X

Sample Application

34 Building an E-Commerce Application

Overview of the E-Commerce Application Using Master Pages, Themes, and User Controls

Building a Component Library

Creating a Custom Site Map Provider

Creating a Shopping Cart...

Protecting Credit Card Numbers

Handling Images

Retrieving Data with AJAX.

Improving Performance Through Caching Conforming to Standards.

Summary

8131703231

005.133