Apress - Pro.ASP.NET.2.0.in.C.Sharp.2005.Special.Edition.Sep.2006.pdf

(26224 KB) Pobierz
374672915 UNPDF
SPECIAL EDITION
FULLY UPDATED AND EXPANDED WITH TWO NEW CHAPTERS:
“JavaScript and Ajax” and “Atlas”
THE EXPERT’S VOICE ® IN .NET
Bonus CD includes
a free ASPToday.com eBook—
over 600 pages—valued at $25!
ASP.NET 2.0
in C# 2005
Create next-generation web applications with the latest
version of Microsoft’s revolutionary technology.
Matthew MacDonald and Mario Szpuszta
Bonus CD contains an additional 2,000 pages of high-quality content from
18 Apress ASP.NET 2.0, C# 2005, VB 2005, SQL Server 2005, and Visual
Studio 2005 titles.
Pro
374672915.044.png 374672915.063.png 374672915.001.png 374672915.002.png 374672915.003.png 374672915.004.png 374672915.005.png 374672915.006.png 374672915.007.png 374672915.008.png 374672915.009.png 374672915.010.png 374672915.011.png 374672915.012.png 374672915.013.png 374672915.014.png 374672915.015.png 374672915.016.png 374672915.017.png 374672915.018.png 374672915.019.png 374672915.020.png 374672915.021.png 374672915.022.png 374672915.023.png 374672915.024.png 374672915.025.png 374672915.026.png 374672915.027.png 374672915.028.png 374672915.029.png 374672915.030.png 374672915.031.png 374672915.032.png 374672915.033.png 374672915.034.png 374672915.035.png 374672915.036.png 374672915.037.png 374672915.038.png 374672915.039.png
 
374672915.040.png
 
374672915.041.png
 
374672915.042.png
 
374672915.043.png
 
374672915.045.png 374672915.046.png 374672915.047.png 374672915.048.png 374672915.049.png 374672915.050.png 374672915.051.png 374672915.052.png 374672915.053.png 374672915.054.png 374672915.055.png
 
374672915.056.png 374672915.057.png 374672915.058.png 374672915.059.png 374672915.060.png 374672915.061.png 374672915.062.png 374672915.064.png 374672915.065.png 374672915.066.png 374672915.067.png 374672915.068.png 374672915.069.png 374672915.070.png
Pro ASP.NET 2.0
in C# 2005
Special Edition
Matthew MacDonald and Mario Szpuszta
374672915.071.png 374672915.072.png 374672915.073.png
Pro ASP.NET 2.0 in C# 2005, Special Edition
Copyright © 2006 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: 978-1-59059-768-2
ISBN-10: 1-59059-768-0
Printed and bound in the United States of America 9 8 7 6 5 4 3 2 1
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, Ewan Buckingham, Gary Cornell, Jason Gilmore, Jonathan Gennick,
Jonathan Hassell, James Huddleston, Chris Mills, Matthew Moodie, Dominic Shakeshaft,
Jim Sumser, Keir Thomas, Matt Wade
Project Manager: Julie M. Smith
Copy Edit Manager: Nicole LeClerc
Copy Editor: Kim Wimpsett
Assistant Production Director: Kari Brooks-Copony
Production Editor: Kelly Winquist
Compositor: Dina Quan
Proofreader: Lori Bring
Indexer: Broccoli Information Management
Artist: Kinetic Publishing Services, LLC
Cover Designer: Kurt Krames
Manufacturing Director: 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/
Download section.
374672915.074.png
374672915.075.png
Contents at a Glance
About the Authors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxviii
About the Technical Reviewers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxix
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxx
PART 1
■ ■ ■ Core Concepts
CHAPTER 1
Introducing ASP.NET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
CHAPTER 2
Visual Studio 2005 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
CHAPTER 3
Web Forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
CHAPTER 4
Server Controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
CHAPTER 5
ASP.NET Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
CHAPTER 6
State Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
PART 2 ■ ■ ■ Data Access
CHAPTER 7 ADO.NET Fundamentals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247
CHAPTER 8 Data Components and the DataSet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285
CHAPTER 9 Data Binding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325
CHAPTER 10 Rich Data Controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365
CHAPTER 11 Caching and Asynchronous Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 425
CHAPTER 12 XML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 471
CHAPTER 13 Files and Streams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 517
PART 3 ■ ■ ■ Building ASP.NET Websites
CHAPTER 14 User Controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 551
CHAPTER 15 Themes and Master Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 571
CHAPTER 16
Website Navigation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 601
CHAPTER 17
Resources and Localization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 651
CHAPTER 18
Website Deployment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 689
iv
374672915.076.png
Zgłoś jeśli naruszono regulamin