Syllabus
Part I Building ASP.NET Pages
1. Overview of the ASP.NET Framework
Lesson overview
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 the ASP.NET Framework
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
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
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 Multi-Part Form
Displaying a Wizard
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
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
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 Multi-Page 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 2005 Express
Features of SQL Server Express
SQL Server 2005 Express Management Tools
Server Databases versus Local Databases
Sample Database-Driven Web Application
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
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
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 ButtonFields
Using HyperLinkFields
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
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
Part IV Building Components
15. Building Components
Building Basic Components
Components and Dynamic Compilation
Mixing Different Language Components in the
App_Code Folder
Contents xi
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 Multi-Tier Applications
Creating the User Interface Layer
Creating the Business Logic Layer
Creating the Data Access Layer
Summary
16. 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
17. 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 the .NET Framework
Building a Data Access Layer with a User-Defined Type
Creating Stored Procedures with the .NET Framework
Creating the Stored Procedure Assembly
Summary
18. 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 Object Relational Designer
Building Entity Associations
Using the LinqDataSource Control
Contents xiii
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
Part V Site Navigation
19. 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
20. 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
21. 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
Storing a Website in Microsoft SQL Server
Summary
Part VI Security
22. 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
Contents xv
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
23. 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 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 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
24. 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
25. 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
Contents xvii
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 Data
Source Caching
Using Push SQL Cache Dependencies with Data Caching
Summary
26. Localizing Applications for Multiple Languages 1369
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
27. 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
28. Configuring Applications
Overview of Website Configuration
Using the Web Site Administration Tool
Using the ASP.NET Microsoft Management Console Snap-In
ASP.NET Configuration
Contents xix
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 Custom Control Building
29. 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
30. 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
31. 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 Lifecycle
UpdatePanel Client-Side Page Execution Lifecycle
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
32. 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
Contents xxi
Using the FilteredTextBox Control
Using the MaskedEdit Control
Using the Animation Control
Using the UpdatePanelAnimation Control
Summary
33. Using Client-Side ASP.NET AJAX
Making JavaScript Look Like C#
Using the Microsoft AJAX Library
Creating an AJAX Client Library
Taking Advantage of JavaScript Intellisense
Working with Classes
Working with Inheritance
Working with Namespaces
Retrieving DOM Elements
Handling DOM Events
Retrieving DOM Event Information
Creating Callbacks and Delegates
Debug and Release AJAX Libraries
Debugging Microsoft AJAX Applications
Calling Web Services from the Client
Calling an External Web Service
Calling a Static Page Method
Editing Movies with AJAX
Using the Authentication Service
Using the Role Service
Using the Profile Service
Creating Custom AJAX Controls and Behaviors
Creating AJAX Controls
Launching a Client-Side Control from the Server
Creating Client-Side Behaviors
Launching a Client-Side Behavior from the Server
Summary
PART X Functional Class Libraries
34. Files and Streams
Working with the File System
The Directory and File Classes
The DirectoryInfo and FileInfo Classes
The DriveInfo Class
Working with Attributes
Filter Files with Wildcards
Retrieving File Version Information
The Path Class
A File Browser
Reading and Writing Files with Streams
Text Files
Binary Files
Uploading Files
Making Files Safe for Multiple Users
Compression
Serialization
Summary
35. XML
When Does Using XML Make Sense?
An Introduction to XML
The Advantages of XML
Well-Formed XML
XML Namespaces
XML Schemas
Stream-Based XML Processing
Writing XML Files
Reading XML Files
In-Memory XML Processing
The XmlDocument
The XPathNavigator
The XDocument
Searching XML Content
Searching with XmlDocument
Searching XmlDocument with XPath
Searching XDocument with LINQ
Validating XML Content
A Basic Schema
Validating with XmlDocument
Validating with XDocument
Transforming XML Content
A Basic Stylesheet
Using XslCompiledTransform
36. Dynamic Graphics and GDI+
The ImageMap Control
Creating Hotspots
Handling Hotspot Clicks
A Custom Hotspot
Drawing with GDI+
Simple Drawing
Image Format and Quality
The Graphics Class
Using a GraphicsPath
Pens
Brushes
Embedding Dynamic Graphics in a Web Page
Using the PNG Format
Passing Information to Dynamic Images
Custom Controls That Use GDI+
Charting with GDI+
37. Cryptography
Encrypting Data: Confidentiality Matters
The .NET Cryptography Namespace
Understanding the .NET Cryptography Classes
Symmetric Encryption Algorithms
Asymmetric Encryption
The Abstract Encryption Classes
The ICryptoTransform Interface
The CryptoStream Class
Part XI Sample Application
Building a Code Sample Website
Overview of the Sample Website
Creating Blog Entries
Creating Code Sample Entries
Data Access and Validation
Using LINQ to SQL
Handling Common Database Operations .
Creating a Single Insert and Update Form
Handling Form Validation
Taking Advantage of Ajax
Using the UpdatePanel Control
Using the ASP.NET AJAX Control Toolkit
Using the VirtualPathProvider Class
|