You are previewing Programming Microsoft® ASP.NET 2.0 Core Reference, 2nd Edition.
O'Reilly logo
Programming Microsoft® ASP.NET 2.0 Core Reference, 2nd Edition

Book Description

Delve into the core topics for ASP.NET 2.0 programming, mastering the essential skills and capabilities needed to build high-performance Web applications successfully. Well-known ASP.NET author Dino Esposito deftly builds your expertise with Web forms, Microsoft Visual Studio®, core controls, master pages, data access, data binding, state management, security services, and other must-know topics—combining definitive reference with practical, hands-on programming instruction. Packed with expert guidance and pragmatic examples, this CORE REFERENCE delivers the key resources you need to develop professional-level Web programming skills.

Table of Contents

  1. Programming Microsoft® ASP.NET 2.0 Core Reference
  2. Dedication
  3. A Note Regarding Supplemental Files
  4. Acknowledgments
  5. Introduction
    1. Who Is This Book For?
    2. System Requirements
    3. Configuring SQL Server 2005 Express Edition
    4. Prerelease Software
    5. Technology Updates
    6. Code Samples
    7. Support for This Book
      1. Questions and Comments
    8. Microsoft Press Online: Resources for Microsoft Visual Studio 2005
  6. I. Building an ASP.NET Page
    1. 1. The ASP.NET Programming Model
      1. What’s ASP.NET, Anyway?
        1. Programming in the Age of Web Forms
        2. Event-Driven Programming over HTTP
        3. The HTTP Protocol
          1. The HTTP Request
          2. The HTTP Response
          3. Building a Server-Side Abstraction Layer
          4. Submitting Forms
        4. Structure of an ASP.NET Page
          1. A Sample ASP.NET Page
          2. Quick Review of the Code
      2. The ASP.NET Component Model
        1. A Model for Component Interaction
        2. The runat Attribute
          1. Working with Server-Side Controls
          2. Pagewide Tags
          3. Unknown Tags
        3. ASP.NET Server Controls
          1. HTML Server Controls
          2. Web Server Controls
      3. The ASP.NET Development Stack
        1. The Presentation Layer
          1. Rich Controls
          2. Custom Controls
          3. Adaptive Rendering
        2. The Page Framework
          1. Page Events
          2. Page Scripting
          3. Page Personalization
          4. Page Styling
          5. Page Prototyping
        3. The HTTP Runtime Environment
          1. System HTTP Modules
          2. Application Configuration
          3. Application Services
      4. The ASP.NET Provider Model
        1. The Rationale Behind the Provider Model
          1. Exemplifying the Provider Model
          2. Benefits of the Provider Model
        2. A Quick Look at the ASP.NET Implementation
          1. The Provider Class
          2. The Configuration Layer
          3. The Storage Layer
          4. Available Types of Providers
      5. Conclusion
    2. 2. Web Development in Microsoft Visual Studio .NET 2005
      1. Introducing Visual Studio .NET 2005
        1. Visual Studio .NET 2003 Common Gripes
          1. Constraints at the Machine Level
          2. Constraints at the IDE Level
        2. Visual Studio .NET 2005 Highlights
          1. No IIS Dependency
          2. Ways to Access Web Sites
          3. Building the Project Output
          4. Copying a Web Project
          5. Smarter Editing with IntelliSense
      2. Create an ASP.NET Project
        1. Page Design Features
          1. Master Pages
          2. Content Pages
          3. Code-Behind Classes
          4. The Toolbox of Controls
          5. Editor’s Special Capabilities
          6. Code Refactoring
          7. Import/Export of IDE Features
        2. Adding Code to the Project
          1. Defining Event Handlers
          2. Writing Helper Classes
          3. Building a Sample Shared Class
          4. A Look at the web.config File
        3. ASP.NET Reserved Folders
          1. Additional Application Directories
          2. The App_Code Directory
          3. The Resource Directories
          4. Linked Web Services
          5. Available Themes
        4. Build the ASP.NET Project
          1. Debugging Features
          2. Testing the Application
      3. Application Deployment
        1. XCopy Deployment
          1. Copying Files
          2. Building a Setup Project
          3. What Else Do You Need to Do?
          4. Configuring the Runtime Environment
        2. Site Precompilation
          1. In-Place Precompilation
          2. Precompilation for Deployment
      4. Administering an ASP.NET Application
        1. The Web Site Administration Tool
          1. Membership and Role Management
          2. Application Settings Management
          3. Selecting and Configuring Providers
        2. Editing ASP.NET Configuration Files
          1. A Visual Editor for web.config Files
          2. When to Use the Configuration Editor
      5. Conclusion
    3. 3. Anatomy of an ASP.NET Page
      1. Invoking a Page
        1. The Runtime Machinery
          1. IIS 5.0 Process Model
          2. IIS 6.0 Process Model
          3. Representing the Requested Page
          4. Partial Classes in ASP.NET Projects
        2. Processing the Request
          1. The HttpRuntime Object
          2. The Application Factory
          3. The HttpApplication Object
          4. The Page Factory
        3. The Processing Directives of a Page
          1. The @Page Directive
          2. The @Assembly Directive
          3. The @Import Directive
          4. The @Implements Directive
          5. The @Reference Directive
      2. The Page Class
        1. Properties of the Page Class
          1. Intrinsic Objects
          2. Worker Properties
          3. Context Properties
        2. Methods of the Page Class
          1. Rendering Methods
          2. Controls-Related Methods
          3. Script-Related Methods
        3. Events of the Page Class
        4. The Eventing Model
          1. Introducing the View State
          2. The Single Form Model
      3. The Page Life Cycle
        1. Page Setup
          1. The PreInit Event
          2. The Init Event
          3. The InitComplete Event
          4. View-State Restoration
          5. Processing Posted Data
          6. The PreLoad Event
          7. The Load Event
          8. Handling Dynamically Created Controls
        2. Handling the Postback
          1. Detecting Control State Changes
          2. Executing the Server-Side Postback Event
          3. The LoadComplete Event
        3. Page Finalization
          1. The PreRender Event
          2. The PreRenderComplete Event
          3. The SaveStateComplete Event
          4. Generating the Markup
          5. The Unload Event
      4. Conclusion
    4. 4. ASP.NET Core Server Controls
      1. Generalities of ASP.NET Server Controls
        1. Properties of the Control Class
          1. Identifying a Server Control
          2. Naming Containers
          3. Binding Containers
          4. Visibility of a Server Control
        2. Methods of the Control Class
        3. Events of the Control Class
        4. New Features
          1. Adaptive Rendering
          2. Browser-Sensitive Rendering
          3. XHTML Compliance
          4. Themeable Controls
          5. Control State
          6. Input Focus
      2. HTML Controls
        1. Generalities of HTML Controls
          1. The HtmlControl Base Class
          2. Working with HTML Attributes
          3. Hierarchy of HTML Controls
        2. HTML Container Controls
          1. Managing Header Information
          2. Navigating to a URL
          3. Handling Events on the Server
          4. The HtmlSelect Control
          5. HTML Tables
          6. The HtmlTextArea Control
        3. HTML Input Controls
          1. Command Buttons
          2. Controlling Validation
          3. Detecting State Changes of Controls
          4. Uploading Files
        4. The HtmlImage Control
      3. Web Controls
        1. Generalities of Web Controls
          1. Properties of Web Controls
          2. Styling Web Controls
          3. Managing the Style of Web Controls
          4. Methods of Web Controls
        2. Core Web Controls
          1. Button Controls
          2. HyperLinks
          3. Images and Image Buttons
          4. Check Boxes and Radio Buttons
          5. Scrollable Panels
          6. Text Controls
          7. Hidden Fields and File Upload
          8. Creating Tables
        3. Miscellaneous Web Controls
          1. The AdRotator Control
          2. The Calendar Control
          3. The Xml Control
          4. The PlaceHolder Control
          5. View Controls
      4. Validation Controls
        1. Generalities of Validation Controls
          1. The BaseValidator Class
          2. Associating Validators with Input Controls
        2. Gallery of Controls
          1. The CompareValidator Control
          2. The CustomValidator Control
          3. The RegularExpressionValidator Control
          4. The RangeValidator Control
          5. The RequiredFieldValidator Control
        3. Special Capabilities
          1. Displaying Error Information
          2. The ValidationSummary Control
          3. Enabling Client Validation
          4. Validation Groups
      5. Conclusion
    5. 5. Working with the Page
      1. Programming with Forms
        1. The HtmlForm Class
          1. Properties of the HtmlForm Class
          2. Methods of the HtmlForm Class
        2. Multiple Forms
          1. Using HTML Forms
          2. Multiple <form> Tags on a Page
          3. Multiple View and Wizards in ASP.NET 2.0
        3. Cross-Page Postings
          1. Posting Data to Another Page
          2. The @PreviousPageType Directive
          3. Detecting Cross-Page Postings
          4. Dealing with Validation
          5. Redirecting Users to Another Page
      2. Dealing with Page Errors
        1. Basics of Error Handling
          1. Default Error Pages
          2. Page-Level Error Handling
          3. Global Error Handling
          4. Robust Error Handling
        2. Mapping Errors to Pages
          1. The <customErrors> Section
          2. Using Custom Error Pages
          3. Handling Common HTTP Errors
          4. Getting Information About the Exception
      3. ASP.NET Tracing
        1. Tracing the Execution Flow in ASP.NET
          1. Enabling Page Tracing
          2. Enabling Tracing Programmatically
        2. Writing Trace Messages
          1. The TraceContext Class
          2. Emitting Trace Messages
          3. Tracing from External Classes
        3. The Trace Viewer
      4. Page Personalization
        1. Creating the User Profile
          1. Definition of the Data Model
          2. The User Profile Class Representation
          3. Using Collection Types
          4. Using Custom Types
          5. Grouping Properties
        2. Interacting with the Page
          1. Creating the Profile Database
          2. Working with Anonymous Users
          3. Accessing Profile Properties
          4. Personalization Events
          5. Migrating Anonymous Data
        3. Profile Providers
          1. Configuring Profile Providers
          2. Structure of AspNetDb.mdf
          3. Custom Profile Providers
      5. Conclusion
    6. 6. Rich Page Composition
      1. Working with Master Pages
        1. Authoring Rich Pages in ASP.NET 1.x
          1. What’s Good About User Controls
          2. What’s Bad About User Controls
          3. Visual Inheritance
        2. Writing a Master Page
          1. What’s a Master Page, Anyway?
          2. The @Master Directive
          3. The ContentPlaceHolder Container Control
          4. Specifying Default Content
        3. Writing a Content Page
          1. The Content Control
          2. Attaching Pages to a Master
          3. Device-Specific Masters
          4. Setting the Title of a Page
        4. Processing Master and Content Pages
          1. Compiling Master Pages
          2. Serving the Page to Users
          3. Nested Master Pages
        5. Programming the Master Page
          1. Exposing Master Properties
          2. Invoking Properties on the Master
          3. The @MasterType Directive
          4. Changing the Master Page Dynamically
      2. Working with Themes
        1. Understanding ASP.NET Themes
          1. What’s a Theme, Anyway?
          2. Structure of a Theme
          3. Customization Themes vs. Style Sheet Themes
        2. Theming Pages and Controls
          1. Enabling Themes on a Page
          2. Applying Skins
          3. Taking Control of Theming
          4. Theming Controls
        3. Putting Themes to Work
          1. CSS vs. Themes
          2. Creating a Theme
          3. Loading Themes Dynamically
      3. Working with Wizards
        1. An Overview of the Wizard Control
          1. Structure of a Wizard
          2. Wizard Styles and Templates
          3. The Wizard’s Programming Interface
        2. Adding Steps to a Wizard
          1. Types of Wizard Steps
          2. Creating an Input Step
          3. Defining the Sidebar
        3. Navigating Through the Wizard
          1. Filtering Page Navigation with Events
          2. Canceling Events
          3. Finalizing the Wizard
      4. Conclusion
  7. II. Adding Data in an ASP.NET Site
    1. 7. ADO.NET Data Providers
      1. .NET Data Access Infrastructure
        1. .NET Managed Data Providers
          1. Building Blocks of a .NET Data Provider
          2. Interfaces of a .NET Data Provider
          3. Managed Providers vs. OLE DB Providers
        2. Data Sources You Access Through ADO.NET
          1. Accessing SQL Server
          2. Accessing Oracle Databases
          3. Using OLE DB Providers
          4. Using ODBC Drivers
        3. The Provider Factory Model
          1. Instantiating Providers Programmatically
          2. Enumerating Installed Data Providers
          3. Database-Agnostic Pages
      2. Connecting to Data Sources
        1. The SqlConnection Class
          1. Properties of the SqlConnection Class
          2. Methods of the SqlConnection Class
          3. Changing Passwords
          4. Accessing Schema Information
        2. Connection Strings
          1. Configuring Connection Properties
          2. Connection String Builders
          3. Storing and Retrieving Connection Strings
          4. Protecting Connection Strings
        3. Connection Pooling
          1. Configuring Pooling
          2. Getting and Releasing Objects
          3. Detecting Connections Leaks
          4. Managing Connection Lifetime
          5. Clearing the Connection Pool
      3. Executing Commands
        1. The SqlCommand Class
          1. Properties of the SqlCommand Class
          2. Methods of the SqlCommand Class
          3. Ways to Execute
        2. ADO.NET Data Readers
          1. Reading Data with the Data Reader
          2. Command Behaviors
          3. Closing the Reader
          4. Accessing Multiple Result Sets
        3. Asynchronous Commands
          1. Setting Up Asynchronous Commands
          2. Nonblocking Commands
          3. Executing Parallel Commands in an ASP.NET Page
          4. Nonblocking Data-Driven ASP.NET Pages
        4. Working with Transactions
          1. Managing Local Transactions as in ADO.NET 1.x
          2. Introducing the TransactionScope Object
          3. Distributed Transactions with TransactionScope
          4. Enlisting in a Distributed Transaction in ADO.NET 1.x
        5. SQL Server 2005–Specific Enhancements
          1. Support for CLR Types
          2. Support for XML as a Native Type
          3. SQL Notifications and Dependencies
          4. Multiple Active Result Sets
      4. Conclusion
    2. 8. ADO.NET Data Containers
      1. Data Adapters
        1. The SqlDataAdapter Class
          1. Programming the SQL Server Data Adapter
          2. Filling a DataSet Using a Data Adapter
          3. Loading Options
        2. The Table-Mapping Mechanism
          1. The Column-Mapping Mechanism
          2. Missing Mapping Action
          3. Missing Schema Action
          4. Prefilling the Schema
        3. How Batch Update Works
          1. Data Conflicts and Optimistic Lock
          2. Command Builders
      2. In-Memory Data Container Objects
        1. The DataSet Object
          1. Reading Stored Data
          2. Merging DataSet Objects
          3. The DataSet Commit Model
          4. Serializing Contents to XML
          5. Serialization and Remoting Format
        2. The DataTable Object
          1. Performing Computations
          2. Columns of a Table
          3. Rows of a Table
          4. Table Constraints
        3. Data Relations
          1. Creating a Data Relation
          2. Performing Calculations on Relations
          3. Serializing a Data Relation
        4. The DataView Object
          1. Navigating the View
          2. Finding Rows
      3. Conclusion
    3. 9. The Data-Binding Model
      1. Data Source–Based Data Binding
        1. Feasible Data Sources
          1. ADO.NET Classes
          2. Collection-Based Classes
        2. Data-Binding Properties
          1. The DataSource Property
          2. The DataSourceID Property
          3. The DataMember Property
          4. The DataTextField Property
          5. The DataValueField Property
          6. The AppendDataBoundItems Property
          7. The DataKeyField Property
        3. List Controls
          1. The DropDownList Control
          2. The CheckBoxList Control
          3. The RadioButtonList Control
          4. The ListBox Control
          5. The BulletedList Control
        4. Iterative Controls
          1. The Repeater Control
          2. The DataList Control
          3. The DataGrid Control
      2. Data-Binding Expressions
        1. Simple Data Binding
          1. Binding in Action
          2. Implementation of Data-Binding Expressions
        2. The DataBinder Class
          1. The Eval Method
          2. A More Compact Eval
          3. Getting the Default Data Item
        3. Other Data-Binding Methods
          1. The XPath Method
          2. The XPathSelect Method
          3. The Bind Method
          4. User-Defined Dynamic Expressions
      3. Data Source Components
        1. Overview of Data Source Components
          1. A Click in the Life of DataGrid
          2. A Click in the Life of GridView
        2. Internals of Data Source Controls
          1. Data Source Views
          2. Interaction with Data-Bound Controls
          3. Hierarchical Data Source Views
        3. The SqlDataSource Control
          1. Programming Interface of SqlDataSource
          2. Declarative Parameters
          3. Conflicts Detection
          4. Caching Behavior
        4. The AccessDataSource Class
          1. Working with an Access Database
          2. Updating an Access Database
        5. The ObjectDataSource Control
          1. Programming Interface of ObjectDataSource
          2. Implementing Data Retrieval
          3. Using Parameters
          4. Caching Data and Object Instances
          5. Setting Up for Paging
          6. Updating and Deleting Data
          7. Configuring Parameters at Run Time
        6. The SiteMapDataSource Class
          1. Displaying Site Map Information
          2. Programming Interface of SiteMapDataSource
        7. The XmlDataSource Class
          1. Programming Interface of XmlDataSource
          2. Displaying XML Data
          3. Transforming XML Data
      4. Conclusion
    4. 10. Creating Bindable Grids of Data
      1. The DataGrid Control
        1. The DataGrid Object Model
          1. Properties of the DataGrid Control
          2. Constituent Elements of a DataGrid
          3. Data Source Rows and Displayed Rows
          4. Events of the DataGrid Control
        2. Binding Data to the Grid
          1. Data-Bound Columns
          2. HyperLink Columns
          3. Button Columns
          4. Templated Columns
        3. Working with the DataGrid
          1. Paging Through the Data Source
          2. Sorting Columns of Data
          3. Editing Existing Rows
      2. The GridView Control
        1. The GridView Object Model
          1. Properties of the GridView Control
          2. Events of the GridView Control
          3. Simple Data Binding
        2. Binding Data to a GridView Control
          1. Configuring Columns
          2. Bound Fields
          3. Button Fields
          4. Hyperlink Fields
          5. CheckBox Fields
          6. Image Fields
          7. Templated Fields
        3. Paging Data
          1. Codeless Data Paging
          2. Moving the Burden of Paging to the DAL
          3. Paging Algorithms
          4. Configuring the Pager
        4. Sorting Data
          1. Codeless Data Sorting
          2. Moving the Burden of Sorting to the DAL
          3. Give Users Feedback
          4. Using Callbacks for Paging and Sorting
        5. Editing Data
          1. In-Place Editing and Updates
          2. Deleting Displayed Records
          3. Inserting New Records
        6. Advanced Capabilities
          1. Executing an Operation on a Given Row
          2. Selecting a Given Row
          3. Row Customization
      3. Conclusion
    5. 11. Managing Views of a Record
      1. The DetailsView Control
        1. The DetailsView Object Model
          1. Properties of the DetailsView
          2. Events of the DetailsView
          3. Simple Data Binding
        2. Binding Data to a DetailsView Control
          1. Controlling the Displayed Fields
          2. Paging Through Bound Data
          3. Paging via Callbacks
        3. Creating Master/Detail Views
          1. Drill Down into the Selected Record
          2. Caching Issues
        4. Working with Data
          1. Editing the Current Record
          2. Deleting the Current Record
          3. Inserting a New Record
          4. Templated Fields
          5. Adding Validation Support
          6. Validating Without Validators
      2. The FormView Control
        1. The FormView Object Model
          1. Members of the FormView Control
          2. Supported Templates
          3. Supported Operations
        2. Binding Data to a FormView Control
          1. Header, Footer, and Pager
          2. Displaying Data
          3. The Eval Function
        3. Editing Data
          1. The Edit Template
          2. The Bind Function
          3. The Insert Template
          4. When the Function Is Not Supported
      3. Conclusion
  8. III. ASP.NET Infrastructure
    1. 12. The HTTP Request Context
      1. Initialization of the Application
        1. Properties of the HttpApplication Class
        2. Application Modules
        3. Methods of the HttpApplication Class
        4. Events of the HttpApplication Class
      2. The global.asax File
        1. Compiling global.asax
        2. Syntax of global.asax
          1. Application Directives
          2. Code Declaration Blocks
          3. Server-Side <object> Tags
          4. Server-Side Includes
          5. Static Properties
        3. Tracking Errors and Anomalies
      3. The HttpContext Class
        1. Properties of the HttpContext Class
        2. Methods of the HttpContext Class
          1. URL Rewriting
          2. Loading Resources Programmatically
      4. The Server Object
        1. Properties of the HttpServerUtility Class
        2. Methods of the HttpServerUtility Class
          1. Embedding Another Page’s Results
          2. Server-Side Redirection
          3. Late-Bound COM Objects
          4. The Importance of AspCompat
      5. The HttpResponse Object
        1. Properties of the HttpResponse Class
          1. Setting the Response Cache Policy
          2. Setting an Output Filter
        2. Methods of the HttpResponse Class
          1. Output Caching Features
          2. Large Files Transmission
      6. The HttpRequest Object
        1. Properties of the HttpRequest Class
          1. Information about the Request
          2. Information from the Client
          3. Information about the Connection
        2. Methods of the HttpRequest Class
          1. Saving the Request to Disk
          2. Validating Client Input
      7. Conclusion
    2. 13. State Management
      1. The Application’s State
        1. Properties of the HttpApplicationState Class
        2. Methods of the HttpApplicationState Class
        3. State Synchronization
        4. Tradeoffs of Application State
          1. Memory Occupation
          2. Concurrent Access to Data
      2. The Session’s State
        1. The Session-State HTTP Module
          1. State Client Managers
          2. Creating the HttpSessionState Object
          3. Synchronizing Access to the Session State
        2. Properties of the HttpSessionState Class
        3. Methods of the HttpSessionState Class
      3. Working with Session’s State
        1. Identifying a Session
          1. Generating the Session ID
          2. Session Cookies
          3. Cookieless Sessions
          4. Issues with Cookieless Sessions
          5. Cookieless Sessions and Security
          6. Configuring the Session State
        2. Lifetime of a Session
          1. The Session_Start Event
          2. The Session_End Event
          3. Why Does My Session State Sometimes Get Lost?
        3. Persist Session Data to Remote Servers
          1. State Serialization and Deserialization
          2. Storing Session Data
          3. Configuring the StateServer Provider
        4. Persist Session Data to SQL Server
          1. Performance and Robustness
          2. Configuring Session State for SQL Server Support
          3. Creating the SQL Server Data Store
          4. Reverting to the Hosting Identity
      4. Customizing Session State Management
        1. Building a Custom Session-State Provider
          1. Defining the Session-State Store
          2. Locking and Expiration
          3. Replacing the Session Data Dictionary
          4. Registering a Custom Session-State Provider
        2. Generating a Custom Session ID
          1. The Default Behavior
          2. A Homemade Session-ID Manager
      5. The View State of a Page
        1. The StateBag Class
          1. View State Properties
          2. View State Methods
        2. Common Issues with View State
          1. Encrypting and Securing
          2. Machine Authentication Check
          3. Size Thresholds and Page Throughput
        3. Programming Web Forms Without View State
          1. Disabling View State
          2. Determining When to Disable View State
        4. Changes in the ASP.NET 2.0 View State
          1. The Serialization Format
          2. The Control State
          3. Programming the Control State
        5. Keeping the View State on the Server
          1. The LosFormatter Class
          2. The ObjectStateFormatter Class
          3. Creating a View-Stateless Page
          4. Saving the View State to a Web Server File
          5. Loading the View State from a Web Server File
      6. Conclusion
    3. 14. ASP.NET Caching
      1. Caching Application Data
        1. The Cache Class
          1. Cache and Other State Objects
          2. Properties of the Cache Class
          3. Methods of the Cache Class
          4. An Interior View
        2. Working with the ASP.NET Cache
          1. Inserting New Items in the Cache
          2. Removing Items from the Cache
          3. Tracking Item Dependencies
          4. Defining a Removal Callback
          5. Setting the Items Priority
          6. Controlling Data Expiration
        3. Practical Issues
          1. Should I Cache or Should I Fetch?
          2. Building a Wrapper Cache Object
          3. Enumerating Items in the Cache
          4. Clearing the Cache
          5. Cache Synchronization
          6. Per-Request Caching
        4. Designing a Custom Dependency
          1. What Cache Dependencies Cannot Do in ASP.NET 1.x
          2. Extensions to the CacheDependency Base Class
          3. Getting Change Notifications
          4. The AggregateCacheDependency Class
        5. A Cache Dependency for XML Data
          1. Designing the XmlDataCacheDependency Class
          2. Implementing the Dependency
          3. Testing the Custom Dependency
        6. SQL Server Cache Dependency
          1. Under the Hood of Database Dependencies
          2. Enabling Database Dependencies in ASP.NET 2.0
          3. Taking Advantage of SQL Server Dependencies
          4. Cache Dependencies in SQL Server 2005
      2. Caching ASP.NET Pages
        1. The @OutputCache Directive
          1. Choosing a Duration for the Page Output
          2. Choosing a Location for the Page Output
          3. Adding a Database Dependency to Page Output
        2. The HttpCachePolicy Class
          1. Properties of the HttpCachePolicy Class
          2. Methods of the HttpCachePolicy Class
          3. Server Cache-Validation Callback
        3. Caching Multiple Versions of a Page
          1. Vary By Parameters
          2. Dealing with Postback Pages
          3. Vary By Headers
          4. Vary By Custom Strings
        4. Caching Portions of ASP.NET Pages
          1. What’s a User Control, Anyway?
          2. Caching the Output of User Controls
          3. Vary By Controls
          4. The Shared Attribute
          5. Fragment Caching in Cacheable Pages
        5. Advanced Features in ASP.NET 2.0
          1. Caching Profiles
          2. Post-Cache Substitution
      3. Conclusion
    4. 15. ASP.NET Security
      1. Where the Threats Come From
      2. The ASP.NET Security Context
        1. Who Really Runs My ASP.NET Application?
          1. IIS Thread Security Context
          2. Worker Process Security Context
          3. ASP.NET Pipeline Security Context
        2. Changing the Identity of the ASP.NET Process
          1. Setting the Process Account
          2. Impersonating a Fixed Identity
          3. Impersonating Through the Anonymous Account
          4. Privileges of the ASP.NET Default Account
        3. The Trust Level of ASP.NET Applications
          1. The <trust> Section
          2. ASP.NET Permissions
          3. Granting Privileges Beyond the Trust Level
        4. ASP.NET Authentication Methods
          1. Windows Authentication
          2. Using ACLs to Authorize Access
          3. Passport Authentication
      3. Using Forms Authentication
        1. Forms Authentication Control Flow
          1. Collecting Credentials Through Login
          2. Authenticating the User
          3. Signing Out
        2. The FormsAuthentication Class
          1. Properties of the FormsAuthentication Class
          2. Methods of the FormsAuthentication Class
        3. Configuration of Forms Authentication
          1. The <forms> Section
          2. Cookie-Based Forms Authentication
          3. Cookieless Forms Authentication in ASP.NET 2.0
          4. Options for Cookieless Authentication
        4. Advanced Forms Authentication Features
          1. Applications to Share Authentication Cookies
          2. External Applications to Authenticate Users
          3. Forms Authentication and Secured Sockets
          4. General Security Issues
      4. The Membership and Role Management API
        1. The Membership Class
          1. The Programming Interface of the Membership Class
          2. Setting Up Membership Support
          3. Validating Users
          4. Managing Users and Passwords
        2. The Membership Provider
          1. The ProviderBase Class
          2. The MembershipProvider Class
          3. Extending the Provider’s Interface
          4. A Custom Provider for ASP.NET 1.x Code
          5. Configuring a Membership Provider
        3. Managing Roles
          1. The Role Management API
          2. The Roles Class
          3. The Role Provider
      5. Security-Related Controls
        1. The Login Control
          1. Setting Up the Login Control
          2. The Programming Interface of the Control
          3. Events of the Control
        2. The LoginName Control
        3. The LoginStatus Control
          1. Setting Up the LoginStatus Control
          2. The Programming Interface of the Control
        4. The LoginView Control
          1. The Programming Interface of the Control
          2. Creating a Login Template
          3. Creating Role-Based Templates
        5. The PasswordRecovery Control
          1. Requirements for Password Retrieval
          2. Retrieving a Password
        6. The ChangePassword Control
          1. User Authentication
          2. Password Change
        7. The CreateUserWizard Control
      6. Conclusion
  9. A. About the Author
  10. B. Additional Resources for C# Developers
  11. C. Additional Resources for Database Developers
  12. D. Additional Resources for Visual Basic Developers
  13. E. Additional Resources for Web Developers
  14. Index
  15. About the Author
  16. Copyright