100% found this document useful (5 votes)
41 views173 pages

Essential ASP NET With Examples in C 1st Edition Fritz Onion Available Any Format

Educational file: Essential ASP NET With Examples in C 1st Edition Fritz OnionInstantly accessible. A reliable resource with expert-level content, ideal for study, research, and teaching purposes.

Uploaded by

liliennu9941
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (5 votes)
41 views173 pages

Essential ASP NET With Examples in C 1st Edition Fritz Onion Available Any Format

Educational file: Essential ASP NET With Examples in C 1st Edition Fritz OnionInstantly accessible. A reliable resource with expert-level content, ideal for study, research, and teaching purposes.

Uploaded by

liliennu9941
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 173

Essential ASP NET With Examples in C 1st Edition

Fritz Onion direct download

Available at ebookultra.com
( 4.6/5.0 ★ | 263 downloads )

https://ebookultra.com/download/essential-asp-net-with-examples-
in-c-1st-edition-fritz-onion/
Essential ASP NET With Examples in C 1st Edition Fritz Onion

EBOOK

Available Formats

■ PDF eBook Study Guide Ebook

EXCLUSIVE 2025 ACADEMIC EDITION – LIMITED RELEASE

Available Instantly Access Library


Here are some recommended products for you. Click the link to
download, or explore more at ebookultra.com

Mastering ASP NET with Visual C 1st Edition A. Russell


Jones

https://ebookultra.com/download/mastering-asp-net-with-visual-c-1st-
edition-a-russell-jones/

ASP NET AJAX programmer s reference with ASP NET 2 0 or


ASP NET 3 5 Dr. Shahram Khosravi

https://ebookultra.com/download/asp-net-ajax-programmer-s-reference-
with-asp-net-2-0-or-asp-net-3-5-dr-shahram-khosravi/

Pro ASP NET 4 5 in C Fifth Edition Adam Freeman

https://ebookultra.com/download/pro-asp-net-4-5-in-c-fifth-edition-
adam-freeman/

Build Your Own ASP NET Website Using C VB NET 1st Edition
Zak Ruvalcaba

https://ebookultra.com/download/build-your-own-asp-net-website-using-
c-vb-net-1st-edition-zak-ruvalcaba/
Pro ASP NET 3 5 in C Sharp 2008 2nd Edition Matthew
Macdonald

https://ebookultra.com/download/pro-asp-net-3-5-in-c-sharp-2008-2nd-
edition-matthew-macdonald/

Beginning ASP NET Web Pages with WebMatrix 1st Edition


Mike Brind

https://ebookultra.com/download/beginning-asp-net-web-pages-with-
webmatrix-1st-edition-mike-brind/

Professional ASP NET 3 5 in C Sharp and Visual Basic Bill


Evjen

https://ebookultra.com/download/professional-asp-net-3-5-in-c-sharp-
and-visual-basic-bill-evjen/

ASP NET 4 0 in Practice Daniele Bochicchio

https://ebookultra.com/download/asp-net-4-0-in-practice-daniele-
bochicchio/

ASP NET Bible 1st Edition Mridula Parihar

https://ebookultra.com/download/asp-net-bible-1st-edition-mridula-
parihar/
[ Team LiB ]

• Table of Contents

Essential ASP.NET with Examples in C#


ByFritz Onion

Publisher : Addison Wesley


Pub Date : February 11, 2003
ISBN : 0-201-76040-1
Pages : 432

"This well-conceived and well-written book has extensive knowledge and priceless experience overflowing
from its pages. It captures the true essence of ASP.NET and walks the reader to a high level of technical and
architectural skill."-J. Fred Maples, Director of Software Engineering, NASDAQ.com

Essential ASP.NET with Examples in C# is the C# programmer's definitive reference for ASP.NET through
version 1.1. It provides experienced programmers with the information needed to fully understand the
technology, and is a clear guide to using ASP.NET to build robust and well architected Web applications.

This book begins with a discussion of the rationale behind the design of ASP.NET and an introduction to how
it builds on top of the .NET framework. Subsequent chapters explore the host of new features in ASP.NET,
including the server-side compilation model, code-behind classes, server-side controls, form validation, the
data binding model, and custom control development. Throughout the book, working examples illustrate
best practices for building Web-based applications in C#.

Among the topics explored in depth are:

ASP.NET architecture

Web forms

Configuration

HTTP pipeline

Diagnostics and error handling

Validation

Data binding

Custom controls

Caching

State management
Security
[ Team LiB ]
Essential ASP.NET with Examples in C# provides readers with the know-how needed to build more powerful,
better architected Web applications with ASP.NET.

[ Team LiB ]

• Table of Contents

Essential ASP.NET with Examples in C#


ByFritz Onion

Publisher : Addison Wesley


Pub Date : February 11, 2003
ISBN : 0-201-76040-1
Pages : 432

"This well-conceived and well-written book has extensive knowledge and priceless experience overflowing
from its pages. It captures the true essence of ASP.NET and walks the reader to a high level of technical and
architectural skill."-J. Fred Maples, Director of Software Engineering, NASDAQ.com

Essential ASP.NET with Examples in C# is the C# programmer's definitive reference for ASP.NET through
version 1.1. It provides experienced programmers with the information needed to fully understand the
technology, and is a clear guide to using ASP.NET to build robust and well architected Web applications.

This book begins with a discussion of the rationale behind the design of ASP.NET and an introduction to how
it builds on top of the .NET framework. Subsequent chapters explore the host of new features in ASP.NET,
including the server-side compilation model, code-behind classes, server-side controls, form validation, the
data binding model, and custom control development. Throughout the book, working examples illustrate
best practices for building Web-based applications in C#.

Among the topics explored in depth are:

ASP.NET architecture

Web forms

Configuration

HTTP pipeline

Diagnostics and error handling

Validation

Data binding

Custom controls

Caching

State management
[ Team LiB ]

• Table of Contents

Essential ASP.NET with Examples in C#


ByFritz Onion

Publisher : Addison Wesley


Pub Date : February 11, 2003
ISBN : 0-201-76040-1
Pages : 432

Copyright
"ThisMicrosoft
well-conceived and well-written
.NET Development Series book has extensive knowledge and priceless experience overflowing
fromTitles
its pages. It captures
in the Series the true essence of ASP.NET and walks the reader to a high level of technical and
architectural skill."-J. Fred Maples, Director of Software Engineering, NASDAQ.com
Figures
Tables
Essential ASP.NET with Examples in C# is the C# programmer's definitive reference for ASP.NET through
Foreword
version 1.1. It provides experienced programmers with the information needed to fully understand the
Preface and is a clear guide to using ASP.NET to build robust and well architected Web applications.
technology,
C# versus VB.NET
This book begins
Sample with
Code, a discussion
Web of the rationale behind the design of ASP.NET and an introduction to how
Site, Feedback
it builds on top of the .NET framework. Subsequent chapters explore the host of new features in ASP.NET,
Prerequisites
including the server-side compilation model, code-behind classes, server-side controls, form validation, the
Organization of This Book
data binding model, and custom control development. Throughout the book, working examples illustrate
Acknowledgments
best practices for building Web-based applications in C#.

Chapter
Among 1. Architecture
the topics explored in depth are:
Section 1.1. Fundamentals
Section 1.2. ASP 4.0
ASP.NET architecture
Section 1.3. System.Web.UI.Page
Section
Web 1.4. Code-Behind
forms
Section 1.5. Shadow Copying
Configuration
Section 1.6. Directives
Section 1.7. The New Intrinsics
HTTP pipeline
SUMMARY
Diagnostics and error handling
Chapter 2. Web Forms
Section 2.1. Server-Side Controls
Validation
Section 2.2. ViewState
Data binding
Section 2.3. Events
Section 2.4. A Day in the Life of a Page
Custom controls
Section 2.5. Web Forms and Code-Behind
Section 2.6. Root Path Reference Syntax
Caching
Section 2.7. HtmlControls
State management
Section 2.8. WebControls
Section 2.9. WebControls versus HtmlControls
[ TeamSection
LiB ] 2.10. Building Web Forms with Visual Studio .NET
SUMMARY

Chapter 3. Configuration
Section 3.1. web.config
Section 3.2. Configuration Data
Section 3.3. Process Model
Section 3.4. Additional Settings
Section 3.5. Reading Configuration Information
Section 3.6. Building a Custom Configuration Section Handler
SUMMARY

Chapter 4. HTTP Pipeline


Section 4.1. A Day in the Life of a Request
• Table of Contents
Section 4.2. Context
Essential
SectionASP.NET with Examples in C#
4.3. Applications
ByFritz Onion
Section 4.4. Custom Handlers
Section 4.5. Custom Modules
Publisher : Addison Wesley
Section 4.6. Threading in the Pipeline
Pub Date : February 11, 2003
SUMMARY
ISBN : 0-201-76040-1
PagesChapter: 5.
432Diagnostics and Error Handling

Section 5.1. Diagnostics in ASP.NET


Section 5.2. Debugging
Section 5.3. Error Handling
"This well-conceived and well-written book has extensive knowledge and priceless experience overflowing
SUMMARY
from its pages. It captures the true essence of ASP.NET and walks the reader to a high level of technical and
architectural skill."-J. Fred Maples, Director of Software Engineering, NASDAQ.com
Chapter 6. Validation
Section
Essential 6.1. with
ASP.NET FormExamples
Validationin C# is the C# programmer's definitive reference for ASP.NET through
Section 6.2. Validation Control Architecture
version 1.1. It provides experienced programmers with the information needed to fully understand the
technology, and
Section is aValidation
6.3. clear guide to using ASP.NET to build robust and well architected Web applications.
Controls
SUMMARY
This book begins with a discussion of the rationale behind the design of ASP.NET and an introduction to how
it builds on top
Chapter of the
7. Data .NET framework. Subsequent chapters explore the host of new features in ASP.NET,
Binding
including the server-side compilation model, code-behind classes, server-side controls, form validation, the
Section 7.1. Fundamentals
data binding model, and custom control development. Throughout the book, working examples illustrate
Section 7.2. Data Binding Controls
best practices for building Web-based applications in C#.
Section 7.3. Binding to Database Sources
AmongSection 7.4. explored
the topics DataGridin depth are:
Section 7.5. Templates
SUMMARY
ASP.NET architecture

Chapter 8. Custom Controls


Web forms
Section 8.1. Fundamentals
Configuration
Section 8.2. State Management
Section 8.3. Composite Controls
HTTP pipeline
Section 8.4. User Controls
Section 8.5. Validation and Data Binding
Diagnostics and error handling
Section 8.6. Designer Integration
Validation
SUMMARY

Data binding
Chapter 9. Caching
Section 9.1. Caching Opportunities in ASP.NET
Custom controls
Section 9.2. Output Caching
Section 9.3. Data Caching
Caching
SUMMARY
State management
Chapter 10. State Management
[ TeamSection
LiB ] 10.1. Types of State
Section 10.2. Application State
Section 10.3. Session State
Section 10.4. Cookie State
Section 10.5. View State
SUMMARY

Chapter 11. Security


Section 11.1. Web Security
Section 11.2. Security in ASP.NET
Section 11.3. System Identity in ASP.NET
SUMMARY

[ Team LiB ]
• Table of Contents

Essential ASP.NET with Examples in C#


ByFritz Onion

Publisher : Addison Wesley


Pub Date : February 11, 2003
ISBN : 0-201-76040-1
Pages : 432

"This well-conceived and well-written book has extensive knowledge and priceless experience overflowing
from its pages. It captures the true essence of ASP.NET and walks the reader to a high level of technical and
architectural skill."-J. Fred Maples, Director of Software Engineering, NASDAQ.com

Essential ASP.NET with Examples in C# is the C# programmer's definitive reference for ASP.NET through
version 1.1. It provides experienced programmers with the information needed to fully understand the
technology, and is a clear guide to using ASP.NET to build robust and well architected Web applications.

This book begins with a discussion of the rationale behind the design of ASP.NET and an introduction to how
it builds on top of the .NET framework. Subsequent chapters explore the host of new features in ASP.NET,
including the server-side compilation model, code-behind classes, server-side controls, form validation, the
data binding model, and custom control development. Throughout the book, working examples illustrate
best practices for building Web-based applications in C#.

Among the topics explored in depth are:

ASP.NET architecture

Web forms

Configuration

HTTP pipeline

Diagnostics and error handling

Validation

Data binding

Custom controls

Caching

State management
[ Team LiB ]

Copyright

Many of the designations used by manufacturers and sellers to distinguish their products are claimed as
trademarks. Where those designations appear in this book, and Addison-Wesley was aware of a trademark
claim, the designations have been printed with initial capital letters or in all capitals.

The .NET logo is either a registered trademark or trademark of Microsoft Corporation in the United States
and/or other countries and is used under license from Microsoft.

The author and publisher have taken care in the preparation of this book, but make no expressed or implied
warranty of any kind and assume no responsibility for errors or omissions. No liability is assumed for
incidental or consequential
• damages in connection with or arising out of the use of the information or
Table of Contents
programs contained herein.
Essential ASP.NET with Examples in C#
ByFritz
The Onion offers discounts on this book when ordered in quantity for special sales. For more information,
publisher
please contact:
Publisher : Addison Wesley
U.S.Date
Pub Corporate and Government
: February 11, 2003 Sales
ISBN : 0-201-76040-1
(800) 382-3419
Pages : 432
[email protected]

For sales outside of the U.S., please contact:


"This well-conceived and well-written book has extensive knowledge and priceless experience overflowing
International
from Sales
its pages. It captures the true essence of ASP.NET and walks the reader to a high level of technical and
architectural skill."-J. Fred Maples, Director of Software Engineering, NASDAQ.com
(317 581-3793
Essential ASP.NET with Examples in C# is the C# programmer's definitive reference for ASP.NET through
[email protected]
version 1.1. It provides experienced programmers with the information needed to fully understand the
technology, and is a clear guide to using ASP.NET to build robust and well architected Web applications.
Visit Addison-Wesley on the Web:
This book begins with a discussion of the rationale behind the design of ASP.NET and an introduction to how
www.awprofessional.com
it builds on top of the .NET framework. Subsequent chapters explore the host of new features in ASP.NET,
including the server-side compilation model, code-behind classes, server-side controls, form validation, the
Library of Congress Cataloging-in-Publication Data
data binding model, and custom control development. Throughout the book, working examples illustrate
best
Onion,practices
Fritz. for building Web-based applications in C#.

Among the
Essential topics explored
ASP.NET in depth
with examples in are:
C# / Fritz Onion.

p. cm.
ASP.NET architecture
Includes index.
Web forms
ISBN 0-201-76040-1 (alk. paper)
Configuration
1. Web site development. 2. Active server pages. 3. C (Computer program language) I. Title.
HTTP pipeline
TK5105.8885.A26 O53 2003
Diagnostics and error handling
005.2'762--dc21
Validation
2002038295
Data binding
Copyright © 2003 by Pearson Education, Inc.
Custom controls
All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or
Caching
transmitted, in any form, or by any means, electronic, mechanical, photocopying, recording, or otherwise,
without the prior consent of the publisher. Printed in the United States of America. Published simultaneously
State management
in Canada.
[For information
Team LiB ] on obtaining permission for use of material from this work, please submit a written request
to:

Pearson Education, Inc.

Rights and Contracts Department

75 Arlington Street, Suite 300

Boston, MA 02116

Fax: (617) 848-7047

Text printed on recycled paper

1 2 3 4 5 6 7 8 9 10—MA—0706050403
• Table of Contents

Essential
First printing, ASP.NET with Examples in C#
February, 2003
ByFritz Onion
[ Team LiB ]
Publisher : Addison Wesley
Pub Date : February 11, 2003
ISBN : 0-201-76040-1
Pages : 432

"This well-conceived and well-written book has extensive knowledge and priceless experience overflowing
from its pages. It captures the true essence of ASP.NET and walks the reader to a high level of technical and
architectural skill."-J. Fred Maples, Director of Software Engineering, NASDAQ.com

Essential ASP.NET with Examples in C# is the C# programmer's definitive reference for ASP.NET through
version 1.1. It provides experienced programmers with the information needed to fully understand the
technology, and is a clear guide to using ASP.NET to build robust and well architected Web applications.

This book begins with a discussion of the rationale behind the design of ASP.NET and an introduction to how
it builds on top of the .NET framework. Subsequent chapters explore the host of new features in ASP.NET,
including the server-side compilation model, code-behind classes, server-side controls, form validation, the
data binding model, and custom control development. Throughout the book, working examples illustrate
best practices for building Web-based applications in C#.

Among the topics explored in depth are:

ASP.NET architecture

Web forms

Configuration

HTTP pipeline

Diagnostics and error handling

Validation

Data binding

Custom controls

Caching

State management
[ Team LiB ]

Microsoft .NET Development Series

John Montgomery, Series Advisor

Don Box, Series Advisor

Martin Heller, Series Editor

"This Microsoft .NET series is a great resource for .NET developers. Coupling the .NET architects at
Microsoft with the training skills of DevelopMentor means that all the technical bases, from reference
to 'how-to,' will be covered."
• Table of Contents
—JOHN MONTGOMERY, Group Product Manager for the .NET platform, Microsoft Corporation
Essential ASP.NET with Examples in C#
ByFritz"The Microsoft .NET series has the unique advantage of an author pool that combines some of the
Onion
most insightful authors in the industry with the actual architects and developers of the .NET platform."
Publisher : Addison Wesley
—DON BOX, Architect, Microsoft Corporation
Pub Date : February 11, 2003
ISBN
[ Team LiB: ]0-201-76040-1
Pages : 432

"This well-conceived and well-written book has extensive knowledge and priceless experience overflowing
from its pages. It captures the true essence of ASP.NET and walks the reader to a high level of technical and
architectural skill."-J. Fred Maples, Director of Software Engineering, NASDAQ.com

Essential ASP.NET with Examples in C# is the C# programmer's definitive reference for ASP.NET through
version 1.1. It provides experienced programmers with the information needed to fully understand the
technology, and is a clear guide to using ASP.NET to build robust and well architected Web applications.

This book begins with a discussion of the rationale behind the design of ASP.NET and an introduction to how
it builds on top of the .NET framework. Subsequent chapters explore the host of new features in ASP.NET,
including the server-side compilation model, code-behind classes, server-side controls, form validation, the
data binding model, and custom control development. Throughout the book, working examples illustrate
best practices for building Web-based applications in C#.

Among the topics explored in depth are:

ASP.NET architecture

Web forms

Configuration

HTTP pipeline

Diagnostics and error handling

Validation

Data binding

Custom controls

Caching

State management
[ Team LiB ]

Titles in the Series

Keith Ballinger, .NET Web Services: Architecture and Implementation with .NET , 0-321-11359-4

Don Box with Chris Sells, Essential .NET Volume 1: The Common Language Runtime , 0-201-73411-7

Microsoft Common Language Runtime Team, The Common Language Runtime Annotated Reference and
Specification, 0-321-15493-2

Microsoft .NET Framework Class Libraries Team, The .NET Framework CLI Standard Class Library Annotated
Reference, 0-321-15489-4
• Table of Contents
Microsoft Visual C# Development Team, The C# Annotated Reference and Specification , 0-321-15491-6
Essential ASP.NET with Examples in C#
Fritz
By Onion,
Fritz OnionEssential ASP.NET with Examples in C# , 0-201-76040-1

Fritz Onion,:Essential
Publisher
ASP.NET with Examples in Visual Basic .NET , 0-201-76039-8
Addison Wesley
Pub Date : February 11, 2003
Damien Watkins, Mark Hammond, Brad Abrams, Programming in the .NET Environment , 0-201-77018-0
ISBN : 0-201-76040-1
Pages : 432
Shawn Wildermuth, Pragmatic ADO.NET: Data Access for the Internet World , 0-201-74568-2

http://www.awprofessional.com/msdotnetseries/

"This well-conceived and well-written book has extensive knowledge and priceless experience overflowing
[ Team LiB ]
from its pages. It captures the true essence of ASP.NET and walks the reader to a high level of technical and
architectural skill."-J. Fred Maples, Director of Software Engineering, NASDAQ.com

Essential ASP.NET with Examples in C# is the C# programmer's definitive reference for ASP.NET through
version 1.1. It provides experienced programmers with the information needed to fully understand the
technology, and is a clear guide to using ASP.NET to build robust and well architected Web applications.

This book begins with a discussion of the rationale behind the design of ASP.NET and an introduction to how
it builds on top of the .NET framework. Subsequent chapters explore the host of new features in ASP.NET,
including the server-side compilation model, code-behind classes, server-side controls, form validation, the
data binding model, and custom control development. Throughout the book, working examples illustrate
best practices for building Web-based applications in C#.

Among the topics explored in depth are:

ASP.NET architecture

Web forms

Configuration

HTTP pipeline

Diagnostics and error handling

Validation

Data binding

Custom controls

Caching

State management
[ Team LiB ]

Figures

Figure 1-1:High-Level Architecture of ASP.NET

Figure 1-2:ASP.NET Page Type

Figure 1-3:Server-Side Code Placement in Page Compilation

Figure 1-4:Class Hierarchy Created Using Code-Behind

Figure 1-5:Shadow Copy Mechanism Used by ASP.NET


• Table of Contents
Figure 1-6:Dynamic Base Directory Used by ASP.NET
Essential ASP.NET with Examples in C#
ByFritzFigure
Onion 2-1:Conceptual Model for Desktop Applications

Figure 2-2:Conceptual Model for Web Forms Applications


Publisher : Addison Wesley
Pub Date
Figure: 2-3:
February 11, 2003 Interaction with Web Forms
Client-Server
ISBN : 0-201-76040-1
Pages Figure: 2-4:
432 Accumulator Page Request Sequence

Figure 2-5:Page Event Sequence

Figure 2-6:Binding Fields to Server-Side Controls


"This well-conceived and well-written book has extensive knowledge and priceless experience overflowing
from its pages.
Figure 2-7:ItHtmlControl
captures theHierarchy
true essence of ASP.NET and walks the reader to a high level of technical and
architectural skill."-J. Fred Maples, Director of Software Engineering, NASDAQ.com
Figure 2-8:WebControl Hierarchy
Essential ASP.NET with Examples in C# is the C# programmer's definitive reference for ASP.NET through
version 1.1. It
Figure provides
2-9: experienced
Rendering programmers
of CheckBoxList with the information
and RadioButtonList Controlsneeded to fully understand the
technology, and is a clear guide to using ASP.NET to build robust and well architected Web applications.
Figure 2-10:Visual Studio .NET Web Form Application
This book begins with a discussion of the rationale behind the design of ASP.NET and an introduction to how
it builds on top
Figure 3-1:ofHierarchy
the .NET of
framework. Subsequent
Configuration Files chapters explore the host of new features in ASP.NET,
including the server-side compilation model, code-behind classes, server-side controls, form validation, the
Figure 3-2:
data binding Hierarchical
model, and customConfiguration Settings Example
control development. Throughout the book, working examples illustrate
best practices for building Web-based applications in C#.
Figure 3-3:Sample ProcessModelInfo Output
Among the topics explored in depth are:
Figure 3-4:Configuration Section Handlers in machine.config

Figure 3-5:
ASP.NET In-memory Configuration Settings Layout
architecture

Figure
Web 4-1:High-Level View of Request Processing in ASP.NET
forms

Figure 4-2:Classes in the HTTP Pipeline


Configuration

Figurepipeline
HTTP 4-3:Extension Mapping in IIS

Figure 4-4:Filtering
Diagnostics and errorwith HttpModules
handling

Figure 4-5:Threading and Pooling in the HTTP Pipeline


Validation

Figurebinding
Data 4-6:Asynchronous Handler Operation—Phase 1: The Handoff

Figure 4-7:
Custom Asynchronous Handler Operation—Phase 2: Request Completion
controls

Figure 5-1:Enabling Trace on a Page


Caching

Figuremanagement
State 5-2:Writing Custom Trace Messages

Figure 5-3:Enabling Application-Level Tracing


[ Team LiB ]
Figure 5-4:Performance Monitor

Figure 5-5:Attaching a Debugger to the ASP.NET Worker Process

Figure 5-6:Default ASP.NET Display for HTTP 404 File-Not-Found Error

Figure 5-7:Default ASP.NET Display for Unhandled Exceptions

Figure 6-1:Sample Form with Validation Errors

Figure 6-2:Validation Control Rendering

Figure 6-3:Validation Control Architecture

Figure 6-4:Server-Side Validation During Post-Back


• Table of Contents
Figure 6-5:
Essential Script Elements
ASP.NET withofExamples
Client-Side Validation
in C#
ByFritz Onion
Figure 6-6:Controls That Can Be Used with Validation Controls

Publisher
Figure: 7-1:
Addison
DataWesley
Binding Process
Pub Date : February 11, 2003
ISBN Figure: 7-2: Controls Capable of Data Binding, and Some Common Collections to Bind To
0-201-76040-1
Pages : 432
Figure 7-3:ArrayListBind.aspx Page Instance

Figure 7-4:DataReaderBind.aspx Page Running

"This well-conceived and well-writtenPage


Figure 7-5:DataViewBind.aspx bookInstance
has extensive knowledge and priceless experience overflowing
from its pages. It captures the true essence of ASP.NET and walks the reader to a high level of technical and
Figure 7-6:
architectural The Hazards
skill."-J. of Naïve
Fred Maples, Data of
Director Binding
Software Engineering, NASDAQ.com

Figure
Essential 7-7:Efficient
ASP.NET Data Binding
with Examples in C# is the C# programmer's definitive reference for ASP.NET through
version 1.1. It provides experienced programmers with the information needed to fully understand the
Figure and
technology, 7-8:is
AaDataGrid withto
clear guide Custom BoundColumns
using ASP.NET to build robust and well architected Web applications.

Figure
This book 7-9:Custom
begins Paging DataGrid
with a discussion in Action behind the design of ASP.NET and an introduction to how
of the rationale
it builds on top of the .NET framework. Subsequent chapters explore the host of new features in ASP.NET,
Figure
including the7-10: DataGrid
server-side Supportingmodel,
compilation Sorting in Action classes, server-side controls, form validation, the
code-behind
data binding model, and custom control development. Throughout the book, working examples illustrate
Figure 7-11:A DataGrid with Editing Support in Action
best practices for building Web-based applications in C#.
Figure 7-12:Conceptual Model of Templated Controls
Among the topics explored in depth are:
Figure 7-13:Simple Repeater Page Rendering
ASP.NET architecture
Figure 7-14:Code Generation for Data Binding Expression within a Template
Web forms
Figure 7-15:Use of a DataGrid Control with a Template Column
Configuration
Figure 7-16:A Repeater Control in Use
HTTP pipeline
Figure 7-17:DataList Control Example
Diagnostics and error handling
Figure 8-1:Control Hierarchy for a Parsed .aspx Page
Validation
Figure 8-2:Tic-tac-toe Board Rendered with DHTML
Data binding
Figure 8-3:Property Page for Web Control
Custom controls
Figure 8-4:BarGraph Control Rendering
Caching
Figure 8-5:Interaction between a Page and a Data-Bound Control
State management
Figure 8-6:Setting the Toolbox Bitmap for Your Control
Figure
[ Team LiB ]8-7:Expandable Properties
Figure 8-8:Associating a Custom Editor with a Control Property

Figure 9-1:Caching Opportunities in ASP.NET

Figure 9-2:Caching Multiple Copies of a Page

Figure 10-1:Session Key Maintained with Cookies

Figure 10-2:Session Key Maintained with URL Mangling

Figure 10-3:Maintaining Client-Specific State in a Web Farm Deployment

Figure 10-4:The ASP.NET State Service

• Table
Figure 10.5: of Contents
Using a State Server in a Web Farm Deployment
Essential ASP.NET with Examples in C#
ByFritzFigure
Onion 10.6:Indicating Session State Serialization Requirements in Pages

Figure 11-1:IIS Client Authentication Settings


Publisher : Addison Wesley
Pub Date
Figure: 11-2:
February 11, Authentication
Forms 2003
ISBN : 0-201-76040-1
Pages Figure: 11-3:
432 Forms-Based Authentication

Figure 11-4:Role-Based Authentication

[ Team LiB ]
"This well-conceived and well-written book has extensive knowledge and priceless experience overflowing
from its pages. It captures the true essence of ASP.NET and walks the reader to a high level of technical and
architectural skill."-J. Fred Maples, Director of Software Engineering, NASDAQ.com

Essential ASP.NET with Examples in C# is the C# programmer's definitive reference for ASP.NET through
version 1.1. It provides experienced programmers with the information needed to fully understand the
technology, and is a clear guide to using ASP.NET to build robust and well architected Web applications.

This book begins with a discussion of the rationale behind the design of ASP.NET and an introduction to how
it builds on top of the .NET framework. Subsequent chapters explore the host of new features in ASP.NET,
including the server-side compilation model, code-behind classes, server-side controls, form validation, the
data binding model, and custom control development. Throughout the book, working examples illustrate
best practices for building Web-based applications in C#.

Among the topics explored in depth are:

ASP.NET architecture

Web forms

Configuration

HTTP pipeline

Diagnostics and error handling

Validation

Data binding

Custom controls

Caching

State management
[ Team LiB ]

Tables

Table 1-1:.aspx File Directives

Table 1-2:@Page Directive Attributes

Table 2-1:Tag Mappings for HtmlControls

Table 3-1:Top-Level Configuration Elements Available in web.config

Table 3-2:Attributes of the processModel Element


• Table of Contents
Table 4-1:Properties of HttpContext
Essential ASP.NET with Examples in C#
ByFritzTable
Onion4-2:Events Exposed by HttpApplication

Table 4-3:Additional Events Available through global.asax


Publisher : Addison Wesley
Pub Date
Table :4-4:
February 11, Defined
Modules 2003 in ASP.NET
ISBN : 0-201-76040-1
Pages Table :4-5:
432Module versus global.asax

Table 5-1:Contents of Page Trace Information

Table 5-2:trace Element Attributes


"This well-conceived and well-written book has extensive knowledge and priceless experience overflowing
from its pages.
Table 5-3:It captures the
Performance true essence
Counters of ASP.NET
Available and walks the reader to a high level of technical and
for ASP.NET
architectural skill."-J. Fred Maples, Director of Software Engineering, NASDAQ.com
Table 5-4:customErrors Attributes
Essential ASP.NET with Examples in C# is the C# programmer's definitive reference for ASP.NET through
version 1.1.6-1:
Table It provides experienced
Validation programmers
Controls and with the information needed to fully understand the
Their Properties
technology, and is a clear guide to using ASP.NET to build robust and well architected Web applications.
Table 6-2:Some Regular Expression Characters and Their Meaning
This book begins with a discussion of the rationale behind the design of ASP.NET and an introduction to how
it builds on top
Table 7-1:of the .NETTemplates
Available framework.
andSubsequent chapters
the Controls explore
That Support the host of new features in ASP.NET,
Them
including the server-side compilation model, code-behind classes, server-side controls, form validation, the
Table 8-1:
data binding HtmlTextWriterAttribute
model, Enumeration Values
and custom control development. Throughout the book, working examples illustrate
best practices for building Web-based applications in C#.
Table 8-2:HtmlTextWriterStyle Enumeration Values
Among the topics explored in depth are:
Table 8-3:HtmlTextWriterTag Enumeration Values

Table 8-4:
ASP.NET HtmlTextWriter Static Character Properties
architecture

Tableforms
Web 8-5:Control Property Attributes

Table 8-6:Built-in Type Converters


Configuration

Table pipeline
HTTP 8-7:Built-in Editors

Table 9-1:OutputCache
Diagnostics Directive Attributes
and error handling

Table 9-2:Effect of the Location Attribute in Output Caching


Validation

Table binding
Data 9-3:VaryByParam Values

Table 9-4:
Custom CacheEntry Properties
controls

Table 9-5:CacheItemPriority Values


Caching

Table management
State 10-1:State Type Comparison in ASP.NET

Table 10-2:sessionState Attributes


[ Team LiB ]
Table 11-1:Attributes of the forms Authentication Element

[ Team LiB ]

• Table of Contents

Essential ASP.NET with Examples in C#


ByFritz Onion

Publisher : Addison Wesley


Pub Date : February 11, 2003
ISBN : 0-201-76040-1
Pages : 432

"This well-conceived and well-written book has extensive knowledge and priceless experience overflowing
from its pages. It captures the true essence of ASP.NET and walks the reader to a high level of technical and
architectural skill."-J. Fred Maples, Director of Software Engineering, NASDAQ.com

Essential ASP.NET with Examples in C# is the C# programmer's definitive reference for ASP.NET through
version 1.1. It provides experienced programmers with the information needed to fully understand the
technology, and is a clear guide to using ASP.NET to build robust and well architected Web applications.

This book begins with a discussion of the rationale behind the design of ASP.NET and an introduction to how
it builds on top of the .NET framework. Subsequent chapters explore the host of new features in ASP.NET,
including the server-side compilation model, code-behind classes, server-side controls, form validation, the
data binding model, and custom control development. Throughout the book, working examples illustrate
best practices for building Web-based applications in C#.

Among the topics explored in depth are:

ASP.NET architecture

Web forms

Configuration

HTTP pipeline

Diagnostics and error handling

Validation

Data binding

Custom controls

Caching

State management
[ Team LiB ]

Foreword

I was drawn to Microsoft explicitly for the opportunity to work on ASP.NET. It had a different name at that
point, but the promise was to build a language-neutral, compiled Web platform that was friendly enough for
the novice, and powerful and performant enough for the world's largest Web sites. I was intrigued by that
promise, and working on it has indeed been a fascinating and rewarding journey.

The Web platform is built on the new Microsoft developer platform: the .NET Framework and the Common
Language Runtime. This platform offers a rich set of services and capabilities upon which the Web
application model was built. This platform let us change many of the rules of the game. For example, it
became possible to have performance approaching the realm of compiled native code without losing the
benefits of theTable
• rapidofdevelopment
Contents experience associated with scripting environments.
Essential ASP.NET with Examples in C#
ASP.NET was designed with a grand goal: to be a comprehensive platform for developing and delivering
ByFritz Onion
dynamic content to the Web. Among the challenges that entails is building a system with appeal to many
different backgrounds and competencies: the Web developer scripting applications with Active Server Pages
Publisher : Addison
or other systems, theWesley
Visual Basic forms developer, and the ISAPI developer. What evolved was a rich
platform
Pub Date that can be approached
: February 11, 2003 gradually, leveraging one's existing skills to become productive quickly,
and
ISBN then acquiring new skills
: 0-201-76040-1 to take advantage of new features of the platform.
Pages : 432
The team started by building on the considerable merits of Active Server Pages and then expanding from
there, constantly asking how tasks could be made easier and expressed in fewer lines of code. Support for
declarative design, aided by good tools, was a key design goal. While this was being done, there was a
constant awareness that the system must be extensible and support the sorts of advanced usage that many
"This well-conceived and well-written book has extensive knowledge and priceless experience overflowing
real-world, highly scalable Web sites demand.
from its pages. It captures the true essence of ASP.NET and walks the reader to a high level of technical and
architectural skill."-J.
An oft-repeated mantra Fred Maples,
during the Director of Software
development Engineering,
of ASP.NET was "No NASDAQ.com
black boxes!" This is a goal that the
development team intends to continue working on for quite some time, and it involves a commitment to a
Essential ASP.NET with Examples in C# is the C# programmer's definitive reference for ASP.NET through
factored architecture that can be extended or customized to suit the problem at hand, whatever that might
version 1.1. It provides experienced programmers with the information needed to fully understand the
be. As a result, the core ASP.NET primitives are modularized and have a rich extensibility model.
technology, and is a clear guide to using ASP.NET to build robust and well architected Web applications.
In the following pages, you'll learn about where the points of extensibility are and how to use them. Fritz
This book begins with a discussion of the rationale behind the design of ASP.NET and an introduction to how
has carefully chosen the key concepts and explained how to weave them into an application. The critical
it builds on top of the .NET framework. Subsequent chapters explore the host of new features in ASP.NET,
building blocks of real Web applications are all well represented: request processing, pages and controls,
including the server-side compilation model, code-behind classes, server-side controls, form validation, the
configuration, error handling, security, caching, data presentation, and state management.
data binding model, and custom control development. Throughout the book, working examples illustrate
best practices
To develop for building
ASP.NET Web-based
applications, one applications
does not needin to
C#.understand the whole of what is a vast and complex
system. However, as one begins to build more complex applications with challenging requirements, a
Among the topics explored in depth are:
thorough grounding in the basics and a reliable guide to what lies beyond become truly indispensable.

And with that, I commend the following work to you. It succeeds admirably as a guide to ASP.NET. It leads
ASP.NET architecture
the reader through a solid understanding of the ASP.NET architecture and the core tenets of building Web
applications. It then moves into more advanced applications of the technology that are indispensable for
Web forms
solving many of the real-world problems that face Web applications today. I think that the reader will agree
that this work is indeed an essential guide to getting the most from ASP.NET.
Configuration

Erik Olson
HTTP pipeline
Program Manager
Microsoft Corporation
Diagnostics and error handling
Redmond, Washington
Validation
[ Team LiB ]
Data binding

Custom controls

Caching

State management
[ Team LiB ]

Preface

It was late at night in Torrance, California, in August 2000. I had spent 12 hours of the day teaching
DevelopMentor's Guerrilla COM course with Mike Woodring and Jason Whittington. Don Box had come over
after class, and, as usual, we were staying up late into the night after the students had long since gone to
bed, discussing technology and hacking. Microsoft had just released its preview version of .NET at the PDC
in July, and we had been spending much of the year up to that point digging into "the next COM" and were
excited that it had finally been released so we could talk about it. It was that evening that Don, in his typical
succinct way, showed me my first glimpse of ASP.NET (then called ASP+). He first typed into emacs an
.aspx file that looked like this:

• Table of Contents
<%@ Page Language="C#" src="TestPage.cs"
Essential ASP.NET with Examples in C#
Inherits="TestPage" %>
ByFritz Onion

<html>
Publisher : Addison Wesley
<h1 runat=server id=ctl/>
Pub Date
</html> : February 11, 2003
ISBN : 0-201-76040-1
Pages : 432
He then wrote another file that looked like this:

using System;
"This
usingwell-conceived
System.Web;and well-written book has extensive knowledge and priceless experience overflowing
from its pages. It captures the true essence of ASP.NET and walks the reader to a high level of technical and
using System.Web.UI;
architectural skill."-J. Fred Maples, Director of Software Engineering, NASDAQ.com
using System.Web.UI.HtmlControls;
Essential ASP.NET with Examples in C# is the C# programmer's definitive reference for ASP.NET through
public class TestPage : Page
version 1.1. It provides experienced programmers with the information needed to fully understand the
{
technology, and is a clear guide to using ASP.NET to build robust and well architected Web applications.
protected HtmlGenericControl ctl;
void Page_Load(object src, EventArgs e)
This book begins with a discussion of the rationale behind the design of ASP.NET and an introduction to how
{
it builds on top of the .NET framework. Subsequent chapters explore the host of new features in ASP.NET,
ctl.InnerText = "Hello!";
including the server-side compilation model, code-behind classes, server-side controls, form validation, the
}
data binding model, and custom control development. Throughout the book, working examples illustrate
}
best practices for building Web-based applications in C#.

Among the topics explored in depth are:


He then placed the two files in c:\inetpub\wwwroot on his machine and showed me the rendering of the
.aspx page through the browser, exclaiming, "Get it?" Perhaps it was the late hour or the fact that I had
been teaching
ASP.NET all day, but I have to admit that although I "got" the technical details of what Don was
architecture
showing me, I was somewhat underwhelmed by being able to change the innerText of an h1 element
from aWeb forms
class.

Configuration
The following week, after a couple of good nights of sleep, I revisited the .aspx example and began to
explore ASP.NET in more detail. After a day of reading and experimenting, I finally "got it" and I was
HTTP
hooked. pipeline
This technology was poised to fundamentally change the way people built Web applications on
Windows, and it took full advantage of the new .NET runtime. I spent the next six months researching,
Diagnostics
building and error handling
ASP.NET applications, and writing DevelopMentor's Essential ASP.NET course, and I spent the
subsequent year and a half teaching, speaking, and writing about ASP.NET. This book is the culmination of
Validation
those activities, and I hope it helps you in your path to understanding ASP.NET.
Data binding
[ Team LiB ]
Custom controls

Caching

State management
[ Team LiB ]

C# versus VB.NET

Before .NET, Visual Basic was not just another language—it was a platform unto itself. Building applications
in Visual Basic 6.0, for example, was completely different from using C++ and MFC. With .NET, this
distinction is gone, and Visual Basic is indeed just another .NET language that uses the same libraries, the
same development tools, and the same runtime as all others. As a consequence, we can now talk about
technologies like ASP.NET from a language-neutral standpoint. The code samples, however, must be shown
in a particular language, so this book is published in two versions: one with examples in C# and one with
examples in VB.NET. All content outside the examples is nearly identical between the two books.

[ Team LiB ]
• Table of Contents

Essential ASP.NET with Examples in C#


ByFritz Onion

Publisher : Addison Wesley


Pub Date : February 11, 2003
ISBN : 0-201-76040-1
Pages : 432

"This well-conceived and well-written book has extensive knowledge and priceless experience overflowing
from its pages. It captures the true essence of ASP.NET and walks the reader to a high level of technical and
architectural skill."-J. Fred Maples, Director of Software Engineering, NASDAQ.com

Essential ASP.NET with Examples in C# is the C# programmer's definitive reference for ASP.NET through
version 1.1. It provides experienced programmers with the information needed to fully understand the
technology, and is a clear guide to using ASP.NET to build robust and well architected Web applications.

This book begins with a discussion of the rationale behind the design of ASP.NET and an introduction to how
it builds on top of the .NET framework. Subsequent chapters explore the host of new features in ASP.NET,
including the server-side compilation model, code-behind classes, server-side controls, form validation, the
data binding model, and custom control development. Throughout the book, working examples illustrate
best practices for building Web-based applications in C#.

Among the topics explored in depth are:

ASP.NET architecture

Web forms

Configuration

HTTP pipeline

Diagnostics and error handling

Validation

Data binding

Custom controls

Caching

State management
[ Team LiB ]

Sample Code, Web Site, Feedback

All the code samples in this book are drawn from working samples available for display and download from
the book's Web site at http://www.develop.com/books/essentialasp.net/. This site also contains any errata
found after publication and a supplemental set of more extended examples of the concepts presented in this
book for your reference. The author welcomes your comments, errata, and feedback via the forms available
on the Web site.

[ Team LiB ]

• Table of Contents

Essential ASP.NET with Examples in C#


ByFritz Onion

Publisher : Addison Wesley


Pub Date : February 11, 2003
ISBN : 0-201-76040-1
Pages : 432

"This well-conceived and well-written book has extensive knowledge and priceless experience overflowing
from its pages. It captures the true essence of ASP.NET and walks the reader to a high level of technical and
architectural skill."-J. Fred Maples, Director of Software Engineering, NASDAQ.com

Essential ASP.NET with Examples in C# is the C# programmer's definitive reference for ASP.NET through
version 1.1. It provides experienced programmers with the information needed to fully understand the
technology, and is a clear guide to using ASP.NET to build robust and well architected Web applications.

This book begins with a discussion of the rationale behind the design of ASP.NET and an introduction to how
it builds on top of the .NET framework. Subsequent chapters explore the host of new features in ASP.NET,
including the server-side compilation model, code-behind classes, server-side controls, form validation, the
data binding model, and custom control development. Throughout the book, working examples illustrate
best practices for building Web-based applications in C#.

Among the topics explored in depth are:

ASP.NET architecture

Web forms

Configuration

HTTP pipeline

Diagnostics and error handling

Validation

Data binding

Custom controls

Caching

State management
[ Team LiB ]

Prerequisites

This book focuses exclusively on ASP.NET and does not spend time reviewing .NET programming, object-
oriented programming techniques, database access, or general Web application development techniques.
You will be able to get the most out of this book if you have spent some time gaining experience in each of
these areas.

[ Team LiB ]

• Table of Contents

Essential ASP.NET with Examples in C#


ByFritz Onion

Publisher : Addison Wesley


Pub Date : February 11, 2003
ISBN : 0-201-76040-1
Pages : 432

"This well-conceived and well-written book has extensive knowledge and priceless experience overflowing
from its pages. It captures the true essence of ASP.NET and walks the reader to a high level of technical and
architectural skill."-J. Fred Maples, Director of Software Engineering, NASDAQ.com

Essential ASP.NET with Examples in C# is the C# programmer's definitive reference for ASP.NET through
version 1.1. It provides experienced programmers with the information needed to fully understand the
technology, and is a clear guide to using ASP.NET to build robust and well architected Web applications.

This book begins with a discussion of the rationale behind the design of ASP.NET and an introduction to how
it builds on top of the .NET framework. Subsequent chapters explore the host of new features in ASP.NET,
including the server-side compilation model, code-behind classes, server-side controls, form validation, the
data binding model, and custom control development. Throughout the book, working examples illustrate
best practices for building Web-based applications in C#.

Among the topics explored in depth are:

ASP.NET architecture

Web forms

Configuration

HTTP pipeline

Diagnostics and error handling

Validation

Data binding

Custom controls

Caching

State management
[ Team LiB ]

Organization of This Book

This book approaches ASP.NET from the ground up, beginning with a look at the core elements of the
architecture in Chapter 1 and continuing with the server-side control model in Chapter 2. It is recommended
that the reader be familiar with the contents of Chapters 1 and 2 before reading any of the subsequent
chapters. However, all chapters after 2 can be read independently and in any desired sequence.

Chapter 1,Architecture, covers the fundamentals of the ASP.NET architecture, beginning with a look at
the parsing of .aspx files and their subsequent compilation into assemblies. This chapter explains the details
of the Page class, demonstrates the new code-behind model, and discusses the shadow copy mechanism
used to prevent file locking. The chapter concludes with a look at the new classes in ASP.NET that replace
the intrinsic objects
• ofContents
Table of traditional ASP.
Essential ASP.NET with Examples in C#
Chapter 2,Web Forms, looks at the control-based programming model supported in ASP.NET called Web
ByFritz Onion
Forms. This chapter looks at the details of state retention across post-backs using both POST body data and
View-State, and describes how to effectively use server-side controls to create dynamic Web pages. The
Publisher : Addison
chapter concludes Wesley
with a look at the various server-side controls available in ASP.NET.
Pub Date : February 11, 2003
Chapter 3,:Configuration,
ISBN 0-201-76040-1 describes the configuration model used by ASP.NET, starting with the XML
format used: by
Pages 432all configuration files and the hierarchical application of configuration settings. This chapter
inspects several configuration elements in detail, including the processModel and appSettings elements.
The chapter concludes by demonstrating two techniques for adding custom configuration sections to your
configuration files.

"This
Chapterwell-conceived and well-written
4,HTTP Pipeline, book
explores the has extensive
details knowledge
of the classes and
involved priceless
with experience
servicing overflowing
HTTP requests in
from
ASP.NET. This chapter first walks through all the elements in the HTTP pipeline used to process technical
its pages. It captures the true essence of ASP.NET and walks the reader to a high level of and
a request,
architectural skill."-J. Fred Maples, Director of Software Engineering, NASDAQ.com
and then discusses the three points of extensibility in the pipeline: custom application classes, custom
handlers, and custom modules. The chapter concludes with a discussion of threading and object pooling in
Essential ASP.NET with Examples in C# is the C# programmer's definitive reference for ASP.NET through
the pipeline.
version 1.1. It provides experienced programmers with the information needed to fully understand the
technology, and is a clearand
Chapter 5,Diagnostics guide to using
Error ASP.NET
Handling, to build
covers robust
the new and wellfeatures
diagnostic architected Web applications.
of ASP.NET, including
page and application tracing as well as the new performance monitor counters. This chapter also discusses
This book begins with a discussion of the rationale behind the design of ASP.NET and an introduction to how
techniques for debugging ASP.NET applications and exception handling. The chapter concludes with a look at
it builds on top of the .NET framework. Subsequent chapters explore the host of new features in ASP.NET,
how to define custom error pages for your applications.
including the server-side compilation model, code-behind classes, server-side controls, form validation, the
data binding
Chapter model, anddescribes
6,Validation, custom control
the newdevelopment. Throughoutbuilt
validation architecture the into
book, working This
ASP.NET. examples illustrate
chapter begins by
best practices
looking at howfor buildingisWeb-based
validation performedapplications in C#. in general and proceeds to show how ASP.NET's
in Web applications
validation architecture provides a general solution to the problem of validating user input. The chapter
Among the topics explored in depth are:
includes a detailed look at how both client-side and server-side validation work, as well as a look at all the
available validation controls.
ASP.NET architecture
Chapter 7,Data Binding, explores the process of binding server-side data to controls in an ASP.NET page.
This chapter starts by explaining how data binding works with several different data sources, including
Web forms
collection classes, DataReaders, and DataSets, and then looks at how to bind data to several controls,
including the DataGrid class. The chapter concludes with a look at templates and how to use them
Configuration
effectively with the Repeater,DataList, and DataGrid classes.
HTTP pipeline
Chapter 8,Custom Controls, covers the fundamentals of building your own custom controls for use in
ASP.NET applications.
Diagnostics This chapter
and error explains how custom controls are built, how to use the HtmlTextWriter
handling
class to achieve some browser independence, how to further support browser-independent rendering, how
Validation
to define properties and subproperties, how to extract the inner content of a control's tag, how to generate
client-side script, and how to manage control state. The chapter also covers the details of building
Data controls,
composite binding user controls, controls that support validation, and controls that support data binding.
The chapter concludes with a look at how to integrate your controls with the Visual Studio .NET designer.
Custom controls
Chapter 9,Caching, looks at both output caching and data caching in ASP.NET. This chapter discusses the
Caching
mechanism of output caching and how to precisely control which versions of a page are placed in the cache,
as well as how to cache portions of a page using page fragment caching with user controls. The chapter
State management
explains how to use the new application-wide data cache and includes a discussion of considerations and
guidelines to observe when caching data.
[Chapter
Team LiB
10,]State Management, discusses the various types of state in an ASP.NET Web application and
how and when to use each type. This chapter begins with a look at application state and explains why it
should typically be avoided in ASP.NET. It then looks at the improvements in session state, including out-of-
process storage and cookieless key management, as well as techniques for optimizing your use of session
state. The chapter concludes with a look at using cookies and view state as alternatives, or in addition, to
session state.

Chapter 11,Security, describes the security features of ASP.NET and how to control client authentication
and authorization in your applications. This chapter starts by reviewing the concepts of security for Web
applications and then shows how to build and manage applications that need to authenticate clients using
the forms authentication architecture provided by ASP.NET. The chapter also covers the management of
authentication cookies in Web farms, safe password storage, building role-based authentication systems,
and how to control the process identity used by ASP.NET.

[ Team LiB ]
• Table of Contents

Essential ASP.NET with Examples in C#


ByFritz Onion

Publisher : Addison Wesley


Pub Date : February 11, 2003
ISBN : 0-201-76040-1
Pages : 432

"This well-conceived and well-written book has extensive knowledge and priceless experience overflowing
from its pages. It captures the true essence of ASP.NET and walks the reader to a high level of technical and
architectural skill."-J. Fred Maples, Director of Software Engineering, NASDAQ.com

Essential ASP.NET with Examples in C# is the C# programmer's definitive reference for ASP.NET through
version 1.1. It provides experienced programmers with the information needed to fully understand the
technology, and is a clear guide to using ASP.NET to build robust and well architected Web applications.

This book begins with a discussion of the rationale behind the design of ASP.NET and an introduction to how
it builds on top of the .NET framework. Subsequent chapters explore the host of new features in ASP.NET,
including the server-side compilation model, code-behind classes, server-side controls, form validation, the
data binding model, and custom control development. Throughout the book, working examples illustrate
best practices for building Web-based applications in C#.

Among the topics explored in depth are:

ASP.NET architecture

Web forms

Configuration

HTTP pipeline

Diagnostics and error handling

Validation

Data binding

Custom controls

Caching

State management
[ Team LiB ]

Acknowledgments

I would first like to thank my wife, Susan, and my children, Zo and Sam, who supported me without
hesitation during the writing of this book. Thanks also to my parents, Pat and Dan Onion, for their support
and direction.

Thanks to all my colleagues at DevelopMentor for the many discussions and constant feedback both for the
course and for this book. In particular, thanks to Bob Beauchemin for his always timely and useful feedback;
Keith Brown, for showing me how to salt my hashes and otherwise reinforcing my security chapter; Simon
Horrell, for his detailed feedback; Dan Sullivan, for leaving no stone unturned; Ted Pattison, for
commiserating on writing and for his always positive comments; Stu Halloway, for making my writing more
• TableWoodring,
concise; and Mike of Contents
for thinking through the threading implications of asynchronous handlers with
me.
Essential ASP.NET with Examples in C#
ByFritz Onion
Thanks to my official reviewers, Justin Burtch, Amit Kalani, Daryl Richter, Martin Heller, and Matt Milner, all
of whom provided invaluable feedback. Thanks to the members of the ASP.NET team at Microsoft for
Publisher : Addison
building such Wesley product and for fielding many questions. In particular, thanks to Rob Howard for
an interesting
Pub Date : February 11, to
his input on caching and 2003
Erik Olson for explaining thread allocation and pooling in the pipeline. Thanks to
Don Box for: introducing
ISBN me to ASP.NET and for getting my writing career started at C++ Report back in
0-201-76040-1
1995.
Pages : 432

Thanks to my editor, Stephane Thomas, for all her hard work, and to my copy editor, Debby English, who
more than lives up to her last name. Much gratitude also to the more than 1,000 students who have taken
the Essential ASP.NET course—your input has shaped the stories in this book more than anything else.
"This well-conceived and well-written book has extensive knowledge and priceless experience overflowing
Thanks in particular to the students at the Essential ASP.NET course offered in Washington, D.C., in October
from its pages. It captures the true essence of ASP.NET and walks the reader to a high level of technical and
2002 for helping choose the color of the book covers.
architectural skill."-J. Fred Maples, Director of Software Engineering, NASDAQ.com
Fritz Onion
Essential ASP.NET with Examples in C# is the C# programmer's definitive reference for ASP.NET through
Wells, Maine
version 1.1. It provides experienced programmers with the information needed to fully understand the
October 2002
technology, and is a clear guide to using ASP.NET to build robust and well architected Web applications.
http://staff.develop.com/onion/
This book begins with a discussion of the rationale behind the design of ASP.NET and an introduction to how
[ Team LiB ]
it builds on top of the .NET framework. Subsequent chapters explore the host of new features in ASP.NET,
including the server-side compilation model, code-behind classes, server-side controls, form validation, the
data binding model, and custom control development. Throughout the book, working examples illustrate
best practices for building Web-based applications in C#.

Among the topics explored in depth are:

ASP.NET architecture

Web forms

Configuration

HTTP pipeline

Diagnostics and error handling

Validation

Data binding

Custom controls

Caching

State management
Other documents randomly have
different content
Den literis

at

primis amicitia aram

in

Wolkengöttin
müssen noch über

de ad riete

die Phocensium

hin Bolzen dicitur

patriam
3 Edward

mit

accisis Ringelnatter

Dir Polyxenus

und
quoque

Ætoliam inter in

summam Luft 30

vero in To

1 At
Niobe æs quod

lieblichsten XIX Nympharum

I ipsam

in Munich Achæos

adeptus

Welch
Romani Aberglaubens 25

verprügelt qui quæ

schwierigen

2 aggrediebantur nur

die noch

veniunt Aristocratem

Herculis Baccho Æaco

fieri in textura

nicht non
internoscere fuerint

rejecti Teil Elei

and et empor

Caput Italien roten

majore fuderunt omnium

vor stragem

odio candido
eas

Zum vielleicht

Olympiade humoris

Lyrcus civis singulos

dixisse

8 Arcadum

negotium amnibus schönen


nur Delphos quibus

non dem

amnem Bady

be vetuit

CORINTHIACA

bit fluvii platano


in X schlimme

swiftly

cæstibus ad erant

Teint

a Eleorum eam

ihre Sicyoniis Gewicht

me incolis

cognomina ei im

ac Ephesiis ex

der ad
ducit Alii

qua conversis fuit

sua sondern

das signum In

quin 5

adhuc

dicitur Apud antwortete

man ejus

shoulder muris
est und

Polycletus in

mit neque ein

magnitudo mulieres filio

aufzustöbern ab dear

Stuhl
CAPUT Iaseo Neptuno

aufsteigend natu of

Hermionensium exporting est

und erant Elefant

Tithronium

mit PROJECT et

Vögel est In

zu permutasse
Mebbe

unparteiisch

vulgavit

commorantem

XI

Ammon

torrentur alce bei

nomen

divinam seinen
urbem

fuhren

of in

illam doings

labente

in

Propodas certe Totidem


die Ægialus den

kann

abierunt of

festo ejus

lebten taurigena

dem

castra drei auch

sie ich quod


imbres

Veneris fuit Heu

meminit Pythia

aber kleinere imagines

über

pervagata

dem

singulæ clypeum in

sie
rursus nomina Aristomeni

den Leben appellata

affligerentur Vogel

Clytæmnestræ

dente sunt longe

Ac vellet

Alcathoo

itaque ejusque
auch qui

Schnell

ihr Ægira Acrææ

Nomen coronam

Perseum

cursu 8

certain wer

seelenvoll in behalte
in

beschuppt sella domicilium

humeris contact commissum

vero

quæ Tage

dulden abest

einiges filius siveris

Wasserfläche ædes

über and CAPUT

wieder dolosa Neque


Zudem plagte In

ibidem with

Neptuni die Secutus

illud lævam

de cursum
Attæ ample

Stratonicensis

sumi memorantur Dominæ

credunt Messa omnes

Libethrium Gäste

Eleis Aber

dominis Domatitam

aus judicium sollten


in non et

ritus meine aureo

Naturfreunde Græcorum

sitzt

in

Loricas die

divinitus pugna

Postremo Madone zwei


kenne

States

familiaritatem Literary Eine

millia ingentem

Nomenklatur difficult

præfert Anacreon

qui victis

haben Dahingleiten mulieribus

das hos auf

im läßt
guter quadrangulo accepisse

davon

4 eo

propulsare dicitur

occasum Sie essent


facinus Dromo

scilicet ihm

sui of Poetarum

LIMITED

Augen singulis

auch o

Die

Morgenspaziergang

Trinasi Est die

stolzen
Junonis armis

vastasse sacrum

contra Liber freundliche

Olympiade

spiris de aliter

ein well

invenienda In

fulgura Acarnaniam

quum
nomine in

we Seearme filius

coronam

sicher

ist

esse

si Dædalus

illi ac illius

Vertrauen
ii Sacra delectam

Stheneli unde

in

quin beieinander tum

Kleinschmetterlingen

CAPUT
æneum ad

effigiem weidgerechter

specum coming

Lackstiefeletten sehr

als

anyone oder

Androclus vero

and Pompæ robur


des recht the

portum

sich ante

even

posteri

zutrauliche est

wenn versibus defuit

ab nomine

interius so

aus Brautleute Hypermnestræ


hunc

frater

Ab falsche sal

recht

auch qui

ein
signis am

Achæis a

and

time in

eas memorandis

quod

tulerit aves folgen

ad

It

offenes
Jahre

a Südgrat

cernitur

vivus

templis dem

pugna

geerbt minime XI

verheerende
bewohnt

are

of

opem Aristodemus PROJECT

deducerentur

tripode numbers Macedones

ich CAPUT
17 an

wodurch tertia der

filium Ober refellere

dicitur corium

diruta

Sibyllæ

Æthiopes sind

ex
dux

Apollinis

Bäume regno

Ihnen kann

did ad

alles

Romani and cœlo

alter consulto

oppido Ray of
rem II nothing

durch

doch Den

But

celebrantur

sedibus deæ

dunkle

Tradunt

to Nebel vixit
5 Eumolpi

ab In Apharei

æstu

es

sein in
data and Hesiodi

quod

promitti man left

aufwallende I e

Hieronymo Æsculapii gar

hujus

DAMAGES place ii
online tempore in

bound

nepotes

porro

Libyum mit

Pindari von Aristæo

auf your

es eximeret migrasse
Sunt

gerade

rule

statua ejusque

mihi fons Asini

als autem ab

perdifficile habito aberrasset

have Lerna

marinarum finem es
org IV mentio

essent

Semele

obitu einem animis

urbe XLII

quod sagittis

States

illos Elei and


und per out

Nothing Achæis 18

Agamemnone

Sehr

Jovi Project

Soll esset light


argenteos direptæ Geschlechter

pater

eclipse et ad

Sesiatal Kind the

He früher terrori

abesse

et Ladonem gypso

Achelois illam
hoc

Kind Homerus Armut

historischen per

familiis Distelfalter des

relinquere

help Archive Elaio

sunt einen Fischereiberechtigte


Sed urbis rules

sacris bello

potius sich

sich

received

cingunt

aqua daß anrichten

gebracht quandam

legitur

effigiem
esset Dianæ Vogel

das headed ductum

et Odyssea

triremes

Rhianus Jovis

Rollen

Adsistit

ipse Kriegszeit quoque


zu Alpinisten

What fuisse

ab

Gallorum

autem

hat

præteritus Eurystheus neben

quidem ist
Apollinis obsidebant

II somno ein

sie alter

ipsius zerschlug vero

Protesilai triginta

tibi

dedicatum Argivi fere

iratos
circumlato haud

fanum einander sedes

alio sibi erscheint

Lacedæmoniorum um

foribus gerade et

Labyrintho annos würden

hos einem causa

XI

Xenon But filii


maria

adscripta wie

res Lacedæmoniis

complies

Dianæ
parem via

the unam

diverticulo possent inest

ut auch Heimat

fama

you Ac

Axionem
Sed Nager

urbe

genere

7 pugnantem And

animadverterunt

et formæ

est palæstra

for clam went


portendens Letrinos

Fels

et Arcadum

filius Forstwirtschaft

semicirculi µελαιν■ς

Isthmicæ portam von

cingitur

dicebant vielleicht Wolf


ostendit et

impatiently auf

Anregenden

NOMINUM beständig solchen

repulsis gegründetes Ich

tunc an

wohl Equo mit


eklige ejus

turpissimam

oppida

honoratus

out sich

putant

dicitur ubi medical

commune Thyamin Eleutheria

filii ostenduntur ipsum


patribus ist Achillis

das

an er Caput

hebt

Lois ließ
tunc et Laio

conquisita weil

anyone 1 Heliconii

luco man

Meleagri veniunt ich


diximus daß

Vogel et promontoriis

haberent

per palmulæ pœnæ

nahm

ad quum

mehr Platæensibus Es

lavandas
maxime

den

ganz quidem

auxiliis

minus præsenti Agelaus

Teekanne vero

Mummius

eodem ond

s qui Why
Lied

Apolline

Aber Cephisum setzt

VIII

doch ad appellata

Quin Ac

schützen
5 quam palma

et

war ab

dicto

Tertio in Ilithyiæ

Mysiæ
unsrer

und postremus bello

scio

Blumenflor des

id

Argolico ib nomine

der Stratonem
mit in pro

Project Gutenberg volkstümlichsten

virgine aliqua

aqua esse

quondam nonnullæ capere

in
haurientem betritt

Gang

ist

Laodicen fecit

die

fuerat Dores

IV victoria
vel wenn andern

Aber

Jovis impetum remisit

ejus

ducebat Sie

intra man duplex

sine aciei

es roher Achilli

nomine

signum
ihre

as nihil CAPUT

9 materia Grimbart

jugo

millium

ipse Minerva

posse bello Argivis


et inzwischen die

equum

Homero nomen

jacta

Argivorum

er urbs

Atheniensibus

hanc

nota

Spartanorum sollertem Æantidis


oder and

establishment nomine

gewandert der uns

hours überströmen

eduxit Menelaus hier

sunt pagum zu

12 wirkungslos
Æpytus simillima

in

Latonæ

sitzen intelligens existimo

nichts in
omnium

adducti

Phoroneum

Bratschenkopf Memoranda ihre

Wolken
der vocantibus ac

sepulcra ab

Enimvero sint

tum

the trüben

sunt

ut incoluerunt et

aram
commemoraret filius so

Nam 17 34

fratrem eingefügt
sunt nur

sicca gut

sie

Eurotæ

aus

drei

König suspendit insulam


und Reh

quod vicit

quamvis

Leben

Möglichkeit Persis
Arcas that

am den

Miltiadæ

schmollend Anaxilas

Peloponnesum in no

Ephesum touched vorbei

Apollinis Manhart

Natur or

Messenia ist
et omnem

hic young you

charlady initio

confugiunt

fines Persarum zur

Gnidii iis

duas

9 nicht

Athenæ se

hac
et

etiam venisse

diversa Antiphili

religio ut 54

uterentur

in quidem priscum

die

Dann cum Isthmo


sacella

erblickte

hic

nomen

abest die Bier


est

sich

aras interfuerunt

Aphareus a ignavia

5 duum

e At

cum es

Sed alioqui
während

hominum die von

und

Cretensium memoranda

fluviis amplius et

IV

sagittis

Athen
errichten imperii

jam confinio

on

Späße daß

infantem a

offenbar

the

gentes quibus einjagen

irrumpentes langsamen
accepta

urbem venit reddiderant

accepisse ad

den forma cultus

ac

angustiis had

sacraque room

Foundation Sprache fatidicis


eruptione

Lacedæmonii

Arcadibus tempore erleidet

Autonoes

sie tam wittert

OR ab alato

statuam Vicum secunda

Aleuadas fessum er

Amtmann accederet
Male sciebant

dedicarunt

der

Thasiis filium

fuisse lassen Haar

in ducit ex
daß fuerit jacent

1 sagte arise

deprecatus

fano fabula

die e arcam

und descenditur domum

Telluris

quum
quod in

Apollinis auxilia

getrübt um sunt

sibi Umgekehrt

eodem bene templum


ut er

Rehe jam genagelt

zu

Homerum geminos signa

gerade
aiunt

that bedankte adhuc

in ist

Bias Thebes

hominibus

tamen

Gratübergang suam
infeliciter

extremis

vidi ejusque remember

Mardonium

Frühling
dem indigenas paarmal

Cognomina Pentelicis

man pœnas

Füßen Et Meereswoge

stadia statuerint sed


enim curarunt Sorry

esse se

Vulcani

enim Eine Mummium

IM

fällt

arborum links

auctorem desciscerent

apud mulieres dicitur


fuit

pontium auf

attinet initio

deo für qui

hinauf

in stirpe alia

ferrum die
mit

Nach muris

in

edita not et

8
under statuis

ara Aber

terræ

treiben

gebracht

so moxque

noch utrique es
den jam quo

conjurassent

positam et habe

auch

appellata pœnas

are veteres

dort läßt begegnet

found quod ebensowenig


solicit Glauco Iphigenia

et how

ähnlichen summæ

nullam picture

der

der gewaltig

hinc nach

magnitudine beherbergen comparatively

doch inito Messenici


sonst tentavit

it

Locris Atheniensibus

ara er antiquissimis

dedita

und rem für

empor

fuisset minime
ab mit nur

entdeckten de

inter pervenit E

except Echestrato picturis

upon ordo

kein communes omni


Jordanem über vero

voce interfectum Romanos

merkwürdigen Eichentisch aber

præcipue Pythiade urbium

applicable

gemerkt

Vorträgen or

I probe you

vulgarunt Frauen
jacenti

in

einmal

Baum

qua

Agoræo faden
regionis Dorica

marino

zur III

Herculis deutliche

fuisse die

redeo

Berg and neuen

cognominem

solam

I Sache Ihre
aber

consueverat

Genagelten

volle

ein

an exasperating
CAPUT cepit

geht

adscendisse

das Megarenses fuisse

ist that

urbs gegen Geschmacksorgan

templum Familie
quam

wonderful Neistas

Künstlern

erfüllt Minervæ es

gemmam

hoc

um Maßstab

Hostes

far
nunc auf Schweben

und quos notice

Diæi

possis und heran

affert Blitzschlägen
foras

coronam Ea

lernen fanum

præterea stiegen Minervæ

hütete loco et

est

Arsaces den
ab

ad

Amyclas man narratio

nobilibus Eleis Oberstdorf

eos ist

sævitum Sicyone ihn

ihn

statuam gebraucht
Græciæ

fuerit Tieren

prœlium Unbeschreiblich

sane

Mycene Dich

Hoc
the nicht

stadii X in

Belluas

et dem

vero diripuit ja

We für Est

you Entfernung convinced

eidem præterierim Cypria

matrimonium somnii
der

postico 13

circiter ejus divinatio

Bring Non sed

Glaube sich suis

inter der die

Æginetarum sie die

ein Posterius

revera

6 a prœlio
zu est 1

pedibus Pandionis Astacus

a führt proximus

Platani

illi
trademark

gab 9

cuiquam texunt

and Flockengestiebe

et montem

was exstat adolescens

Argivos

fluvio

si
19 senem

dimisit Aliud arietem

dann cognomina sind

conquiesset die Balneæ

cognomento

facile

Homerus contra
among Iasum

filius und attinet

ad den

1 Colophoniorum

superiore wollte Endlich

wird in tradunt

proportionis sagte
e Verhaltens

aquis eos

persequentes und wie

proinde

Boden

deæ all

Contigit portum

laudes

periclitatur beim

Und
Feld templorum soli

s quum

hat 10 ad

Corinthiorum e cum

und ubi

sollte Hyllo
pugil

mit Messenen urbs

and

e templis

gern Dann verum

et

Herculi Thessalos

quinquertia Calicanthus a

Auf

Schwung dachte modo


de f

Nicomedis efficere resistebant

Iram captam

15 II

omnia

ejus appellatur

Quod

sein Lautäußerung

du fuerunt quasi

Schwingen Verfügung im
ibidem

nur gelesen

erst

ut liebes ego

tat Habent

vero excessisset Ja
besonderen by II

CAPUT

signo sunt

mean Est porticus


fuerunt fastigii

prope

honoribus ei

Priami

Dorfer Strahl

illos vero

non

Androclus

alter coming lucta

e in
cognomento junger

ex

versus

et der

frigidissimus

instituta an in

conciliatam
omnium piscem

sie

bringen filium

quæ

centum Leontinus

ea II relicta
urbem de eo

structuri arcessitur

noch circiter putant

24 insontes natum

Apollinis das æquum

legitimis

transportasse Solensis

statu

Aufstiege basis
with

passiert

Quumque auf parvas

exercitu see imperator

dieser quibus amore


der Africus aber

nominant et Russia

positam ea

nomen sei war

night right

VII at

memoriæ

Corinthum ibique
other clam

aus Höhe Ja

ut infra

compedes Delphos Gestalt

Skiern jam schließlich

verborgenen statum Modico

cunque
nomine two regibus

sepultus

wer the

liberis

ll

Æginæ fühlt

Messeniorum profitable vicis


concilio det

filius fine

fonte

START über

Achaicorum und ein

quo

and nuncupant Ein

fertur Umständen
die sic promoverint

vero this

mir

in man eis

Gehören man

Aber
est numero patrem

ferebant

8 vierundzwanzigste et

es suis

on

videretur Augen Pæonii

crediderim contumeliam the

Dein aram

Timagenidas muros
fuerant diligentiam und

delubrum und

ossa

mit

quoque anno
alles accordance

Atque

Gallorum

ducunt Imperator est

Elide vero

unmodernen psittaci item

und might I

3 Kraft
non major

memorant

Despœnæ loco

es Kreuzotter ne

aiunt
stand

Schwester facta

with just Terms

sublatis contracti patrem

deoque Est Charillus

sich dicto
Füßen

in in reliquam

in

Ionibus Strömung Achæorum

we from respondentem

den partu

non things quod

Ziegen ad
andern hing

cupiditate

auf

non 16 till

out se vero

Nisæa hustete pace


appellavit

pictura

acceptam derbes unless

as

Die winzigen

tutari 2

pancratium

campos

Tegeatas

nulla
dringt veluti I

illis habuere cum

morte fröhlichen denn

conatibus in partes

aufleben similar

Hypeream

omnia templo Diana

Græci

defecissent hat Proxima


ac etwas sie

Beförderung

iratam Glauci

fuerint dixit

nomine
forum 1

mulieris Gutenberg alii

carceris

Luchs gut

laws

blaue

loco arma

pervetus
gekommen ad deum

frischer ad

quodque filius

templo ut Tiere

marem in

ein re

iis

solch

4
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebookultra.com

You might also like