Table of Contents

Introduction

Part I: 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 ASP.NET Pages

Understanding Dynamic Compilation

Understanding Control Trees

Using Code-Behind Pages

Handling Page Events

Using the Page.IsPostBack Property

Debugging and Tracing ASP.NET Pages

Tracing Page Execution

Installing ASP.NET

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

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 RegularExpressionValidator Control

Using the CustomValidator Control

Using the ValidationSummary Control

Creating Custom Validation Controls

Creating a LengthValidator Control

Creating an AjaxValidator Control

Summary

4. Using the Rich Controls

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

Storing Advertisements in a Database Table

Tracking Impressions and Transfers

Displaying Different Page Views

Displaying a Tabbed Page View

Displaying a Multipart Form

Displaying a Wizard

Displaying Silverlight Content

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 StyleSheetThemes

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

Creating a Multipage Wizard

Summary

Part III: Performing Data Access

8. Overview of Data Access

Using DataBound Controls

Working with List Controls

Working with Tabular DataBound Controls

Working with Hierarchical DataBound Controls

Working with Other 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 2008 Express

Features of SQL Server Express

SQL Server 2008 Express Management Tools

Server Databases Versus Local Databases

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

Displaying Empty Data

Formatting the GridView Control

Using ViewState with the GridView Control

Using Fields with the GridView Control

Using BoundFields

Using CheckBoxFields

Using CommandFields

Using Button Fields

Using HyperLink Fields

Using ImageFields

Using TemplateFields

Working with GridView Control Events

Highlighting GridView Rows

Displaying Column Summaries

Displaying Nested Master/Details Forms

Extending the GridView Control

Creating a LongTextField

Creating a DeleteButtonField

Creating a ValidatedField

Summary

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

14. Using the ListView and DataPager Controls

Using the ListView Control

Using the LayoutTemplate and ItemTemplate

Using the GroupTemplate

Selecting a Row

Sorting Database Data

Editing Database Data

Using the DataPager Control

Creating a Custom User Interface for Paging

Data Source Paging with the DataPager Control

Summary

15. Using the Chart Control

Chart Control Fundamentals

Displaying Data with the Chart Control

Sorting and Filtering Data

Using Statistical Formulas

Customizing a Chart’s Appearance

Customizing the Background and Plotting Area

Three-Dimensional Charts

Drill-Down Reports

Summary

16. Using the QueryExtender Control

Introduction to the QueryExtender Control

Querying Data with Declarative Syntax

Querying with the ControlFilterExpression

Querying with the CustomExpression

Querying with the DynamicFilterExpression

Querying with the MethodExpression

Sorting with the OrderByExpression

Querying with the PropertyExpression

Querying with the RangeExpression

Querying with the SearchExpression

Building a Sample Page with the QueryExtender Control

Summary

Part IV: Building Components

17. 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 Abstract 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 Multitier Applications

Creating the User Interface Layer

Creating the Business Logic Layer

Creating the Data Access Layer

Summary

18. Using the ObjectDataSource Control

Representing Objects with the ObjectDataSource Control

Binding to a Component

Binding to a DataReader

Binding to a DataSet

Binding to a LINQ to SQL Query

Binding to a Web Service

Using Parameters with the ObjectDataSource Control

Using Different Parameter Types

Passing Objects as Parameters

Paging, Sorting, and Filtering Data with the ObjectDataSource Control

User Interface Paging

Data Source Paging

User Interface Sorting

Data Source Sorting

Filtering Data

Handling ObjectDataSource Control Events

Adding and Modifying Parameters

Handling Method Errors

Handling the ObjectCreating Event

Concurrency and the ObjectDataSource Control

Extending the ObjectDataSource Control

Creating a Custom ObjectDataSource Control

Creating Custom Parameter Objects

Summary

19. Building Data Access Components with ADO.NET

Connected Data Access

Using the Connection Object

Using the Command Object

Using the DataReader Object

Disconnected Data Access

Using the DataAdapter Object

Using the DataTable Object

Using the DataView Object

Using the DataSet Object

Executing Asynchronous Database Commands

Using Asynchronous ADO.NET Methods

Using Asynchronous ASP.NET Pages

Building Database Objects with the .NET Framework

Enabling CLR Integration

Creating User-Defined Types with .NET Framework

Building a Data Access Layer with a User-Defined Type

Creating Stored Procedures with .NET Framework

Creating the Stored Procedure Assembly

Summary

20. Data Access with LINQ to SQL

New C# and VB.NET Language Features

Understanding Automatic Properties

Understanding Initializers

Understanding Type Inference

Understanding Anonymous Types

Understanding Generics

Understanding Lambda Expressions

Understanding Extension Methods

Understanding LINQ

Creating LINQ to SQL Entities

Building Entities by Hand

Building Entities with the LINQ to SQL Designer

Building Entity Associations

Using the LinqDataSource Control

Performing Standard Database Commands with LINQ to SQL

LINQ to Objects Versus LINQ to SQL

Selecting with LINQ to SQL

Inserting with LINQ to SQL

Updating with LINQ to SQL

Deleting with LINQ to SQL

Dynamic Queries

Debugging LINQ to SQL

Creating a Custom LINQ Entity Base Class

Using the Entity Base Class

Performing Standard Data-Access Operations with the EntityBase Class

Performing Validation with the EntityBase Class

Summary

21. Data Access with WCF Data Services

Overview of WCF Data Services

Using Data Services with a Service Reference

Using Data Services with a Data Context

Summary

Part V: Site Navigation

22. Using the Navigation Controls

Understanding Site Maps

Using the SiteMapPath Control

Formatting the SiteMapPath Control

Using the Menu Control

Declaratively Adding Menu Items

Using the Menu Control with the MultiView Control

Binding to a Site Map

Binding to an XML File

Binding to Database Data

Formatting the Menu Control

Using Templates with the Menu Control

Using the TreeView Control

Declaratively Adding Tree Nodes

Displaying Check Boxes with the TreeView Control

Binding to a Site Map

Binding to an XML File

Binding to Database Data

Using Populate On Demand and AJAX

Formatting the TreeView Control

Building a SQL Hierarchical Data Source Control

Summary

23. Using Site Maps

Using the SiteMapDataSource Control

Setting SiteMapDataSource Properties

Using the SiteMap Class

Using the SiteMapNode Class

Advanced Site Map Configuration

Using Security Trimming

Merging Multiple Site Maps

Creating Custom Site Map Attributes

Creating Custom Site Map Providers

Creating the AutoSiteMapProvider

Creating the SqlSiteMapProvider

Generating a Google SiteMap File

Summary

24. Advanced Navigation

Remapping URLs

Creating a Custom UrlRemapper Module

Using the VirtualPathProvider Class

Limitations of the VirtualPathProvider Class

Understanding the VirtualPathProvider Class

Registering a VirtualPathProvider Class

Summary

25. Using the ASP.NET URL Routing Engine

Introduction to URL Routing

Basic URL Routing Scenarios

Mapping Basic URLs

Mapping URLs with Parameters

Mapping URLs with Multiple Segments

Linking to Other Pages with Routes

Advanced URL Routing

Using Routes with Default Parameters

Using Constrained Routes

Security Concerns with Routes

Summary

Part VI: Security

26. 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

Sending a Create User Email Message

Automatically Redirecting a User to the Referring Page

Automatically Generating a Password

Using Templates with the CreateUserWizard Control

Adding Steps to the CreateUserWizard Control

Using the LoginStatus Control

Using the LoginName Control

Using the ChangePassword Control

Sending a Change Password Email

Using Templates with the ChangePassword Control

Using the PasswordRecovery Control

Sending the Original Password

Requiring a Security Question and Answer

Using Templates with the PasswordRecovery Control

Using the LoginView Control

Using Roles with the LoginView Control

Summary

27. Using ASP.NET Membership

Configuring Authentication

Configuring Forms Authentication

Using Cookieless Forms Authentication

Using Sliding Expiration with 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 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 ActiveDirectoryMembershipProvider

Creating a Custom Membership Provider

Using the Role Manager

Configuring the SqlRoleProvider

Configuring the WindowsTokenRoleProvider

Configuring the AuthorizationStoreRoleProvider

Caching Roles in a Browser Cookie

Using the Roles Application Programming Interface

Summary

Part VII: Building ASP.NET Applications

28. Maintaining Application State

Using Browser Cookies

Cookie Security Restrictions

Creating Cookies

Reading Cookies

Setting Cookie Properties

Deleting Cookies

Working with Multivalued 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

Using Profiles

Creating Profile Groups

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

29. 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

Creating Page Output Cache Profiles

Using Partial Page Caching

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

30. Localizing Applications for Multiple Languages

Setting the Current Culture

Setting a Culture Manually

Automatically Detecting a Culture

Setting the Culture in the Web Configuration File

Culture and ASP.NET Controls

Using the CultureInfo Class

Using the CultureInfo Class to Format String Values

Comparing and Sorting String Values

Creating Local Resources

Explicit Localization Expressions

Implicit Localization Expressions

Using Local Resources with Page Properties

Retrieving Local Resources Programmatically

Creating Global Resources

Retrieving Global Resources Programmatically

Using Strongly Typed Localization Expressions

Using the Localize Control

Summary

31. 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

Creating an Asynchronous HTTP Handler

Working with HTTP Applications and HTTP Modules

Creating a Global.asax File

Creating Custom HTTP Modules

Summary

32. Building Dynamic Data Applications

Introducing ASP.NET Dynamic Data

Building a Dynamic Data Application

Working with Dynamic Data Templates

Making Shared Template Changes

Creating Type and Entity-Specific Templates

Summary

33. Building ASP.NET MVC Applications

Introducing the ASP.NET MVC Framework

Models

Views

Controllers

Creating Your First ASP.NET MVC Application

Building an MVC Page

Accepting Form Input

Summary

34. 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

35. Deploying ASP.NET Web Applications

Packaging Web Applications

Using Web.config Transformations

Deploying Databases

One-Click Publishing Web Applications

Summary

Part VIII: Custom Control Building

36. 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 AddParsedSubObject() 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

37. 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

Summary

Part IX: ASP.NET AJAX

38. Using Server-Side ASP.NET AJAX

The Ajax Vision

Server-Side Ajax Versus Client-Side Ajax

Debugging Ajax Applications

Using the UpdatePanel Control

Specifying UpdatePanel Triggers

Nesting UpdatePanel Controls

Updating UpdatePanels Programmatically

UpdatePanels and JavaScript

UpdatePanel Server-Side Page Execution Life Cycle

UpdatePanel Client-Side Page Execution Life Cycle

Canceling the Current Asynchronous Postback

Aborting the Previous Asynchronous Postback

Passing Additional Information During an Asynchronous Postback

Handling UpdatePanel Errors Gracefully

UpdatePanel Performance

Using the Timer Control

Using the UpdateProgress Control

Summary

39. Using the ASP.NET AJAX Control Toolkit

Using the ASP.NET AJAX Control Toolkit

Overview of the Toolkit Controls

Using the AutoComplete Control

Using the AutoCompleteExtender with a Page Method

Using the AutoCompleteExtender with a Web Service Method

Using Text and Value Pairs with the AutoCompleteExtender

Using the DragPanel Control

Using the FilteredTextBox Control

Using the MaskedEdit Control

Using the Animation Control

Using the UpdatePanelAnimation Control

Summary

40. Client-Side Ajax with jQuery

What Is jQuery?

Using the jQuery Library

Creating a jQuery File

The $ Method and $(document).ready()

jQuery Selectors

Calling Web Services from the Client

Calling an External Web Service

Calling a Static Page Method

Summary

Index

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset