APress - Pro ASP.Net 2.0 in C# 2005 (2005).pdf

(28965 KB) Pobierz
27235706 UNPDF
Pro ASP.NET 2.0
in C# 2005
Matthew MacDonald and Mario Szpuszta,
Revising Authors
K. Scott Allen
James Avery
Russ Basiura
Mike Batongbacal
Marco Bellinaso
Matt Butler
Andreas Eide
Daniel Cazzulino
Michael Clark
Richard Conway
Robert Eisenberg
Brady Gaster
James Greenwood
Kevin Hoffman
Erik Johansson
Angelo Kastroulis
Dan Kent
Sitaraman Lakshminarayanan
Don Lee
Christopher Miller
Matt Milner
Jan Narkiewicz
Matt Odhner
Ryan O'Keefe
Andrew Reid
Matthew Reynolds
Enrico Sabbadin
Bill Sempf
Doug Seven
Srinivasa Sivakumar
Thiru Thangarathinam
Doug Thews
27235706.005.png 27235706.006.png 27235706.007.png 27235706.008.png
Pro ASP.NET 2.0 in C# 2005
Copyright © 2005 by Matthew MacDonald and Mario Szpuszta
All rights reserved. No part of this work may be reproduced or transmitted in any form or by any means,
electronic or mechanical, including photocopying, recording, or by any information storage or retrieval
system, without the prior written permission of the copyright owner and the publisher.
ISBN-13 (pbk): 978-1-59059-496-4
ISBN-10 (pbk): 1-59059-496-7
Printed and bound in the United States of America 9 8 7 6 5 4 3 2
Trademarked names may appear in this book. Rather than use a trademark symbol with every occurrence
of a trademarked name, we use the names only in an editorial fashion and to the benefit of the trademark
owner, with no intention of infringement of the trademark.
Lead Editor: Ewan Buckingham
Technical Reviewers: Robert Lair, Jason Lefebvre
Editorial Board: Steve Anglin, Dan Appleman, Ewan Buckingham, Gary Cornell, Tony Davis,
Jason Gilmore, Jonathan Hassell, Chris Mills, Dominic Shakeshaft, Jim Sumser
Associate Publisher: Grace Wong
Project Manager: Kylie Johnston
Copy Edit Manager: Nicole LeClerc
Copy Editor: Kim Wimpsett
Assistant Production Director: Kari Brooks-Copony
Production Editor: Laura Cheu
Compositor: Dina Quan
Proofreaders: Liz Welch and Lori Bring
Indexer: Broccoli Information Management
Artist: Kinetic Publishing Services, LLC
Interior Designer: Diana Van Winkle
Cover Designer: Kurt Krames
Manufacturing Manager: Tom Debolski
Distributed to the book trade worldwide by Springer-Verlag New York, Inc., 233 Spring Street, 6th Floor,
New York, NY 10013. Phone 1-800-SPRINGER, fax 201-348-4505, e-mail orders-ny@springer-sbm.com , or
visit http://www.springeronline.com .
For information on translations, please contact Apress directly at 2560 Ninth Street, Suite 219, Berkeley,
CA 94710. Phone 510-549-5930, fax 510-549-5939, e-mail info@apress.com , or visit http://www.apress.com .
The information in this book is distributed on an “as is” basis, without warranty. Although every precaution
has been taken in the preparation of this work, neither the author(s) nor Apress shall have any liability to
any person or entity with respect to any loss or damage caused or alleged to be caused directly or indi-
rectly by the information contained in this work.
The source code for this book is available to readers at http://www.apress.com in the Source Code section.
27235706.001.png
27235706.002.png
Contents at a Glance
About the Revising Authors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxv
About the Technical Reviewers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxvii
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxix
PART 1
■ ■ ■ Core Concepts
CHAPTER 1
Introducing ASP.NET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
CHAPTER 2
Visual Studio 2005 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
CHAPTER 3
Web Forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
CHAPTER 4
Server Controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
CHAPTER 5
ASP.NET Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
CHAPTER 6
State Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195
PART 2
■ ■ ■ Data Access
CHAPTER 7
ADO.NET Fundamentals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229
CHAPTER 8
Data Components and the DataSet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265
CHAPTER 9
Data Binding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295
CHAPTER 10
Rich Data Controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335
CHAPTER 11 Caching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 391
CHAPTER 12
XML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 425
CHAPTER 13 Files and Streams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 471
PART 3
■ ■ ■ Building ASP.NET Websites
CHAPTER 14 User Controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 505
CHAPTER 15
Themes and Master Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 525
CHAPTER 16
Website Navigation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 555
CHAPTER 17 Resources and Localization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 599
CHAPTER 18 Website Deployment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 619
iv
27235706.003.png
PART 4 ■ ■ ■ Security
CHAPTER 19 The ASP.NET Security Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 667
CHAPTER 20 Forms Authentication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 689
CHAPTER 21 Membership . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 709
CHAPTER 22 Windows Authentication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 751
CHAPTER 23 Authorization and Roles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 777
CHAPTER 24 Profiles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 803
CHAPTER 25 Cryptography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 839
CHAPTER 26 Custom Membership Providers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 867
PART 5 ■ ■ ■ Advanced User Interface
CHAPTER 27 Custom Server Controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 899
CHAPTER 28 Design-Time Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 941
CHAPTER 29 JavaScript . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 975
CHAPTER 30 Dynamic Graphics and GDI+ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1011
CHAPTER 31 Portals with Web Part Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1043
PART 6 ■ ■ ■ Web Services
CHAPTER 32
Creating Web Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1087
CHAPTER 33
Web Service Standards and Extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . 1129
CHAPTER 34
Advanced Web Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1175
INDEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1211
v
27235706.004.png
Zgłoś jeśli naruszono regulamin