Đăng nhập
Hoặc tiếp tục với email
Nhớ mật khẩu
Đang tải... (xem toàn văn)
Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
THÔNG TIN TÀI LIỆU
Cấu trúc
Prelim
Contents
About the Author
About the Technical Reviewer
Acknowledgments
Introduction
About This Book
Who Should Read This Book
What You Need to Use This Book
Code Samples
Chapter Overview
Part 1: Introducing .NET
Part 2: Developing ASP.NET Applications
Part 3: Building Better Web Forms
Part 4: Working with Data
Part 5: Website Security
Part 6: Advanced ASP.NET
Feedback
Introducing .NET
The .NET Framework
The Evolution of Web Development
HTML and HTML Forms
Server-Side Programming
Client-Side Programming
C#, VB, and the .NET Languages
Intermediate Language
The Common Language Runtime
The .NET Class Library
Visual Studio
The Last Word
The C# Language
The .NET Languages
C# Language Basics
Case Sensitivity
Commenting
Statement Termination
Blocks
Variables and Data Types
Assignment and Initializers
Strings and Escaped Characters
Arrays
The ArrayList
Enumerations
Variable Operations
Advanced Math
Type Conversions
Object-Based Manipulation
The String Type
The DateTime and TimeSpan Types
The Array Type
Conditional Logic
The if Statement
The switch Statement
Loops
The for Loop
The foreach Loop
The while loop
Methods
Parameters
Method Overloading
Optional and Named Parameters
Delegates
Types, Objects, and Namespaces
The Basics About Classes
Static Members
A Simple Class
Building a Basic Class
Creating an Object
Adding Properties
Automatic Properties
Adding a Method
Adding a Constructor
Adding an Event
Testing the Product Class
Value Types and Reference Types
Assignment Operations
Equality Testing
Passing Parameters by Reference and by Value
Reviewing .NET Types
Understanding Namespaces and Assemblies
Using Namespaces
Importing Namespaces
Assemblies
Advanced Class Programming
Inheritance
Casting Objects
Partial Classes
Generics
Developing ASP.NET Applications
The Promise of Visual Studio
Creating Websites
Creating an Empty Web Application
Websites and Web Projects
The Hidden Solution Files
The Solution Explorer
Adding Web Forms
Migrating a Website from a Previous Version of Visual Studio
Designing a Web Page
Adding Web Controls
The Properties Window
The Anatomy of a Web Form
The Web Form Markup
The Page Directive
The Doctype
The Essentials of XHTML
Elements
Attributes
Formatting
A Complete Web Page
Writing Code
The Code-Behind Class
Adding Event Handlers
Outlining
IntelliSense
Member List
Error Underlining
Automatically Importing Namespaces
Code Formatting and Coloring
Visual Studio Debugging
The Visual Studio Web Server
Single-Step Debugging
Variable Watches
Web Form Fundamentals
The Anatomy of an ASP.NET Application
ASP.NET File Types
ASP.NET Application Directories
Introducing Server Controls
HTML Server Controls
Converting an HTML Page to an ASP.NET Page
View State
The HTML Control Classes
Adding the Currency Converter Code
Event Handling
Behind the Scenes with the Currency Converter
Error Handling
Improving the Currency Converter
Adding Multiple Currencies
Dissecting the Code . . .
Storing Information in the List
Adding Linked Images
Setting Styles
A Deeper Look at HTML Control Classes
HTML Control Events
Advanced Events with the HtmlInputImage Control
The HtmlControl Base Class
The HtmlContainerControl Class
The HtmlInputControl Class
The Page Class
Sending the User to a New Page
HTML Encoding
Application Events
The global.asax File
Additional Application Events
ASP.NET Configuration
The web.config File
Nested Configuration
Storing Custom Settings in the web.config File
The Website Administration Tool (WAT)
Web Controls
Stepping Up to Web Controls
Basic Web Control Classes
The Web Control Tags
Web Control Classes
The WebControl Base Class
Units
Colors
Fonts
Focus
The Default Button
List Controls
Multiple-Select List Controls
The BulletedList Control
Table Controls
Web Control Events and AutoPostBack
How Postback Events Work
The Page Life Cycle
A Simple Web Page
Improving the Greeting Card Generator
Generating the Cards Automatically
Error Handling, Logging, and Tracing
Common Errors
Exception Handling
The Exception Class
The Exception Chain
Handling Exceptions
Catching Specific Exceptions
Nested Exception Handlers
Exception Handling in Action
Mastering Exceptions
Throwing Your Own Exceptions
Logging Exceptions
Viewing the Windows Event Logs
Writing to the Event Log
Custom Logs
A Custom Logging Class
Retrieving Log Information
Page Tracing
Enabling Tracing
Tracing Information
Request Details
Trace Information
Control Tree
Session State and Application State
Request Cookies and Response Cookies
Headers Collection
Form Collection
Query String Collection
Server Variables
Writing Trace Information
Application-Level Tracing
State Management
The Problem of State
The ViewState Collection
A View State Example
Making View State Secure
Tamper-Proof View State
Private View State
Retaining Member Variables
Storing Custom Objects
Transferring Information Between Pages
Cross-Page Posting
Getting More Information from the Source Page
The Query String
A Query String Example
URL Encoding
Cookies
A Cookie Example
Session State
Session Tracking
Using Session State
A Session State Example
Session State Configuration
Cookieless
Timeout
Mode
InProc
Off
StateServer
SQLServer
Compression
Application State
An Overview of State Management Choices
Building Better Web Forms
Validation
Understanding Validation
The Validation Controls
Server-Side Validation
Client-Side Validation
A Simple Validation Example
Other Display Options
Manual Validation
Validating with Regular Expressions
Literals and Metacharacters
Finding a Regular Expression
A Validated Customer Form
Validation Groups
Rich Controls
The Calendar
Formatting the Calendar
Restricting Dates
The AdRotator
The Advertisement File
The AdRotator Class
Pages with Multiple Views
The MultiView Control
Creating Views
Showing a View
The Wizard Control
Wizard Steps
Wizard Events
Formatting the Wizard
Validation with the Wizard
User Controls and Graphics
User Controls
Creating a Simple User Control
Independent User Controls
Integrated User Controls
User Control Events
Passing Information with Events
Dynamic Graphics
Basic Drawing
Drawing a Custom Image
Placing Custom Images Inside Web Pages
Image Format and Quality
Styles, Themes, and Master Pages
Styles
Style Types
Creating a Basic Inline Style
The Style Builder
The CSS Properties Window
Style Inheritance
Creating a Style Sheet
The CSS Outline Window
Applying Style Sheet Rules
The Apply Styles Window
Creating More Styles
Themes
How Themes Work
Applying a Simple Theme
Handling Theme Conflicts
Creating Multiple Skins for the Same Control
More Advanced Skins
Master Page Basics
A Simple Master Page and Content Page
How Master Pages and Content Pages Are Connected
A Master Page with Multiple Content Regions
Default Content
Master Pages and Relative Paths
Advanced Master Pages
Style-Based Layouts
Code in a Master Page
Interacting with a Master Page Programmatically
Website Navigation
Site Maps
Defining a Site Map
Rule 1: Site Maps Begin with the <siteMap> Element
Rule 2: Each Page Is Represented by a <siteMapNode> Element
Rule 3: A <siteMapNode> Element Can Contain Other <siteMapNode> Elements
Rule 4: Every Site Map Begins with a Single <siteMapNode>
Rule 5: Duplicate URLs Are Not Allowed
Seeing a Simple Site Map in Action
Binding an Ordinary Page to a Site Map
Binding a Master Page to a Site Map
Binding Portions of a Site Map
Showing Subtrees
Using Different Site Maps in the Same File
The SiteMap Class
URL Mapping and Routing
URL Mapping
URL Routing
The SiteMapPath Control
Customizing the SiteMapPath
Using SiteMapPath Styles and Templates
Adding Custom Site Map Information
The TreeView Control
TreeView Properties
TreeView Styles
Applying Styles to Node Types
Applying Styles to Node Levels
The Menu Control
Menu Styles
Menu Templates
Working with Data
ADO.NET Fundamentals
Understanding Databases
Configuring Your Database
SQL Server Express
Browsing and Modifying Databases in Visual Studio
The sqlcmd Command-Line Tool
SQL Basics
Running Queries in Visual Studio
The Select Statement
A Sample Select Statement
Improving the Select Statement
An Alternative Select Statement
The Where Clause
String Matching with the Like Operator
Aggregate Queries
The SQL Update Statement
The SQL Insert Statement
The SQL Delete Statement
The Data Provider Model
Direct Data Access
Creating a Connection
The Connection String
Windows Authentication
User Instance Connections
Storing the Connection String
Making the Connection
The Select Command
The DataReader
Putting It All Together
Filling the List Box
Retrieving the Record
Updating Data
Displaying Values in Text Boxes
Adding a Record
Creating More Robust Commands
Updating a Record
Deleting a Record
Disconnected Data Access
Selecting Disconnected Data
Selecting Multiple Tables
Defining Relationships
Data Binding
Introducing Data Binding
Types of ASP.NET Data Binding
Single-Value, or “Simple,” Data Binding
Repeated-Value, or “List,” Binding
How Data Binding Works
Single-Value Data Binding
A Simple Data Binding Example
Simple Data Binding with Properties
Problems with Single-Value Data Binding
Using Code Instead of Simple Data Binding
Repeated-Value Data Binding
Data Binding with Simple List Controls
A Simple List Binding Example
Strongly Typed Collections
Multiple Binding
Data Binding with a Dictionary Collection
Using the DataValueField Property
Data Binding with ADO.NET
Creating a Record Editor
Data Source Controls
The Page Life Cycle with Data Binding
The SqlDataSource
Selecting Records
How the Data Source Controls Work
Parameterized Commands
Other Types of Parameters
Setting Parameter Values in Code
Handling Errors
Updating Records
Strict Concurrency Checking
The Data Controls
The GridView
Automatically Generating Columns
Defining Columns
Configuring Columns
Generating Columns with Visual Studio
Formatting the GridView
Formatting Fields
Using Styles
Configuring Styles with Visual Studio
Formatting-Specific Values
Selecting a GridView Row
Adding a Select Button
Using a Data Field As a Select Button
Using Selection to Create Master-Details Pages
Editing with the GridView
Sorting and Paging the GridView
Sorting
Sorting and Selecting
Paging
Paging and Selection
Using GridView Templates
Using Multiple Templates
Editing Templates in Visual Studio
Handling Events in a Template
Editing with a Template
Editing with Validation
Editing Without a Command Column
The DetailsView and FormView
The DetailsView
Defining Fields
The FormView
Files and Streams
Files and Web Applications
File System Information
The Path Class
The Directory and File Classes
The DirectoryInfo and FileInfo Classes
The DriveInfo Class
A Sample File Browser
Reading and Writing with Streams
Text Files
Binary Files
Shortcuts for Reading and Writing Files
A Simple Guest Book
Allowing File Uploads
The FileUpload Control
XML
XML Explained
Improving the List with XML
XML Basics
Comments
The XML Classes
The XML TextWriter
The XML Text Reader
Working with XML Documents in Memory
Reading an XML Document
Searching an XML Document
XML Validation
XML Namespaces
Writing XML Content with Namespaces
XML Schema Definition
Validating an XML Document
XML Display and Transforms
The Xml Web Control
Website Security
Security Fundamentals
Understanding Security
Testing and Deploying Security Settings
Authentication and Authorization
Forms Authentication
Web.config Settings
Authorization Rules
Controlling Access to Specific Directories
Controlling Access to Specific Files
Controlling Access for Specific Users
The WAT
The Login Page
Retrieving the User’s Identity
Signing Out
Persistent Cookies
A Windows Authentication Test
Membership
The Membership Data Store
Membership with SQL Server Express
Using the Full Version of SQL Server
Configuring the Membership Provider
Creating Users with the WAT
The Membership and MembershipUser Classes
Authentication with Membership
Disabled Accounts
The Security Controls
The Login Control
The CreateUserWizard Control
The PasswordRecovery Control
Role-Based Security
Creating and Assigning Roles
Restricting Access Based on Roles
The LoginView Control
Profiles
Understanding Profiles
Profile Performance
How Profiles Store Data
Using the SqlProfileProvider
Enabling Authentication
Using SQL Server Express
The Profile Databases
Defining Profile Properties
Using Profile Properties
Profile Serialization
Profile Groups
Profiles and Custom Data Types
Custom Type Serialization
Automatic Saves
The Profile API
Anonymous Profiles
Migrating Anonymous Profiles
Advanced ASP.NET
Component-Based Programming
Why Use Components?
Component Jargon
Three-Tier Design
Encapsulation
Business Objects
Data Objects
Components and Classes
Creating a Component
Classes and Namespaces
Class Members
Adding a Reference to the Component
Using the Component
Properties and State
A Stateful Account Class
A Stateless AccountUtility Class
Data-Access Components
A Simple Data-Access Component
Using the Data-Access Component
Enhancing the Component with Error Handling
Enhancing the Component with Aggregate Information
The ObjectDataSource
Making Classes the ObjectDataSource Can Understand
Using Method Parameters
Caching
Understanding Caching
When to Use Caching
Caching in ASP.NET
Output Caching
Caching on the Client Side
Caching and the Query String
Caching with Specific Query String Parameters
A Multiple Caching Example
Fragment Caching
Cache Profiles
Data Caching
Adding Items to the Cache
A Simple Cache Test
Caching to Provide Multiple Views
Caching with the Data Source Controls
Caching with SqlDataSource
Caching with ObjectDataSource
Caching with Dependencies
File Dependencies
Cache Item Dependencies
SQL Server Cache Dependencies
Enabling the Service Broker
Initializing the Caching Service
Creating the Cache Dependency
LINQ and the Entity Framework
Understanding LINQ
LINQ Basics
LINQ Expressions
Projections
Filtering and Sorting
The Entity Framework
Creating an Entity Data Model
The Data Model Diagram
Updating a Data Model
The Data Model Code
Entities
Contexts
Querying the Data Model
Navigating Relationships
Getting More Advanced with the Entity Framework
Querying with LINQ to Entities
Controlling When Data is Loaded
Updates, Inserts, and Deletes
Managing Concurrency
The EntityDataSource
Displaying Data
Editing Data
ASP.NET AJAX
Understanding Ajax
Ajax: The Good
Ajax: The Bad
The ASP.NET AJAX Toolkit
The ScriptManager
Partial Refreshes
A Simple UpdatePanel Test
Conditional Updates
Triggers
Progress Notification
Showing a Simulated Progress Bar
Cancellation
Timed Refreshes
The ASP.NET AJAX Control Toolkit
Installing the ASP.NET AJAX Control Toolkit
The Accordion
The AutoCompleteExtender
Getting More Controls
Deploying ASP.NET Applications
ASP.NET Applications and the Web Server
How Web Servers Work
The Virtual Directory
Web Application URLs
Web Farms
Internet Information Services (IIS)
The Many Faces of IIS
Installing IIS in Windows 7 or Windows Vista
Installing IIS 7 in Windows Server 2008
Managing Websites with IIS Manager
Creating a Virtual Directory
Understanding Application Pools
The ASP.NET Account
Changing the ASP.NET Account
Giving the ASP.NET Account More Privileges
Configuring a Website
The ASP.NET Configuration Icons
The IIS Configuration Icons
The Management Configuration Icons
The Default Page
Custom Error Pages
The Machine Key
Confidentiality with SSL and Certificates
Creating a Certificate Request
Implementing SSL
Deploying a Simple Site
Web Applications and Components
Other Configuration Steps
Code Compilation
Deploying with Visual Studio
Creating a Virtual Directory for a New Project
Copying a Website
Publishing a Website
Index
¦ ¦ ¦ ¦ Special Characters and
Numbers
¦ A
¦ B
¦ C
¦ D
¦ E
¦ F
¦ G
¦ H
¦ I
¦ J
¦ K
¦ L
¦ M
¦ N
¦ O
¦ P
¦ Q
¦ R
¦ S
¦ T
¦ U
¦ V
¦ W
¦ X
¦ Y
¦ Z
Nội dung
Ngày đăng: 11/07/2018, 15:13
TÀI LIỆU CÙNG NGƯỜI DÙNG
TÀI LIỆU LIÊN QUAN