没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
Microsoft
®
ASP.NET 4
Step by Step
George Shepherd
Table of Contents
Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xix
Who This Book Is For. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xx
Getting Started. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xx
Finding Your Best Starting Point in This Book. . . . . . . . . . . . . . . . . . . . . . .xxi
Conventions and Features in This Book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxii
Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxii
Other Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xxiii
Prerelease Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xxiii
Hardware and Software Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xxiii
Code Samples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xxiv
Digital Content for Digital Book Readers . . . . . . . . . . . . . . . . . . . . . . . . .xxiv
Installing the C# Code Samples. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xxiv
Using the Code Samples. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xxvi
Uninstalling the Code Samples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xxix
Support for This Book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xxix
We Want to Hear from You . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xxix
Fundamentals
Web Application Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
HTTP Requests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
HTTP Requests from a Browser . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Making HTTP Requests Without a Browser. . . . . . . . . . . . . . . . . . . . . . . . . . 6
Hypertext Markup Language. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Dynamic Content . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
HTML Forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Common Gateway Interface: Very Retro . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
The Microsoft Environment as a Web Server . . . . . . . . . . . . . . . . . . . . . . . 12
Internet Information Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Internet Services Application Programming Interface DLLs. . . . . . . . . . . 13
Running Internet Information Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Classic ASP: Putting ASP.NET into Perspective . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Web Development Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
ASP.NET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Chapter 1 Quick Reference. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
ASP.NET Application Fundamentals . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
The Canonical Hello World Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Mixing HTML with Executable Code. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Server-Side Executable Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
The ASP.NET Compilation Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Coding Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
ASP.NET 1.x Style . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
Modern ASP.NET Style . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
The ASP.NET HTTP Pipeline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
The IIS 5.x and IIS 6.x Pipeline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
The IIS 7.x Integrated Pipeline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
Tapping the Pipeline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Visual Studio and ASP.NET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
Local IIS Web Sites. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
File System–Based Web Sites. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
PUBLISHED BY
Microsoft Press
A Division of Microsoft Corporation
One Microsoft Way
Redmond, Washington 98052-6399
Copyright © 2010 by George Shepherd
All rights reserved. No part of the contents of this book may be reproduced or transmitted in any form or by any means
without the written permission of the publisher.
Library of Congress Control Number: 2010925074
Printed and bound in the United States of America.
1 2 3 4 5 6 7 8 9 WCT 5 4 3 2 1 0
Distributed in Canada by H.B. Fenn and Company Ltd.
A CIP catalogue record for this book is available from the British Library.
Microsoft Press books are available through booksellers and distributors worldwide. For further infor mation about
international editions, contact your local Microsoft Corporation office or contact Microsoft Press International directly
at fax (425) 936-7329. Visit our Web site at www.microsoft.com/mspress. Send comments to mspinput@microsoft.com.
Microsoft, Microsoft Press, Access, ActiveX, DirectX, Expression, Expression Blend, Hotmail, IntelliSense, Internet
Explorer, MS, MSDN, MS-DOS, MSN, SharePoint, Silverlight, SQL Server, Visual Basic, Visual C#, Visual Studio,
Win32, Windows, Windows Live, Windows NT, Windows Server and Windows Vista are either registered trademarks
or trademarks of the Microsoft group of companies. Other product and company names mentioned herein may be the
trademarks of their respective owners.
The example companies, organizations, products, domain names, e-mail addresses, logos, people, places, and events
depicted herein are fictitious. No association with any real company, organization, product, domain name, e-mail address,
logo, person, place, or event is intended or should be inferred.
This book expresses the author’s views and opinions. The information contained in this book is provided without any
express, statutory, or implied warranties. Neither the authors, Microsoft Corporation, nor its resellers, or distributors will
be held liable for any damages caused or alleged to be caused either directly or indirectly by this book.
Acquisitions Editor: Ben Ryan
Developmental Editor: Maria Gargiulo
Project Editor: Melissa von Tschudi-Sutton and Maria Gargiulo
Editorial Production: Waypoint Press, www.waypointpress.com
Technical Reviewer: Kenn Scribner; Technical Review services provided by Content Master, a member of
CM Group, Ltd.
Cover: Tom Draper Design
Body Part No. X16-61997
Dedicated to Sally Bronson Harrison and
Gene Harrison, my second mom and dad.
v
Contents at a Glance
Part I Fundamentals
1 Web Application Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2 ASP.NET Application Fundamentals . . . . . . . . . . . . . . . . . . . . . . . . 25
3 The Page Rendering Model. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
4 Custom Rendered Controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
5 Composite Controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
6 Control Potpourri . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
Part II Advanced Features
7 A Consistent Look and Feel. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
8 Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
9 Logging In . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
10 Data Binding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
11 Web Site Navigation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
12 Personalization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257
13 Web Parts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267
Part III Caching and State Management
14 Session State . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291
15 Application Data Caching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321
16 Caching Output. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343
Part IV Diagnostics and Plumbing
17 Diagnostics and Debugging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 363
18 The HttpApplication Class and HTTP Modules . . . . . . . . . . . . . . 385
19 HTTP Handlers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 405
剩余628页未读,继续阅读
资源评论
- wjwen5212016-09-28浅显易懂,很不错的书。
airchain
- 粉丝: 17
- 资源: 5
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功