About the Book
Get expert guidance on how to use the powerful
new functionality of ASP.NET to build dynamic, scalable, Web-based applications.
ASP.NET, the next generation of Active
Server Pages, provides a new programming model based on the Microsoft®
.NET Framework for writing Web applications. Learn about ASP.NET development—with
reusable code samples in languages such as Microsoft Visual Basic®
.NET and Microsoft Visual C#™—in DESIGNING MICROSOFT ASP.NET APPLICATIONS.
This book provides an in-depth look at how to create ASP.NET applications
and how they work under the covers. You’ll learn how to create Web Forms
and reusable components and how to develop XML Web services. You’ll also
learn how to create database-enabled ASP.NET applications that use XML
(Extensible Markup Language) and ADO.NET (a new version of Microsoft ActiveX®
Data Objects). Coverage in this guide includes:
• Managed code and the common language
runtime
• Overview of the .NET Framework and languages
• The ASP.NET development model
• Creating and using Web Forms and controls
• Creating ASP.NET components
• Balancing server vs. client functionality
• Getting and displaying data: XML and
ADO.NET
• Creating and consuming XML Web services
INCLUDED ON CD-ROM:
• Sample source code in Microsoft Visual
Basic .NET and Microsoft Visual C# for all the book’s examples
Related Books
Microsoft® .NET XML Web Services Step
by Step
Microsoft® Commerce Server 2000 Pocket
Consultant
Microsoft® Commerce Server 2000 Resource
Kit
Table of Contents
Acknowledgments
xi
Introduction
xiii
1 Introduction to ASP.NET Development
1
The Problem:
Developing Dynamic Web Applications 2
One Solution:
Common Gateway Interface 3
The Good News About CGI 5
The Bad News About CGI 6
Another
Solution: Internet Server Application Programming Interface 7
The Good News About ISAPI 10
The Bad News About ISAPI 10
A Better
Solution: Active Server Pages 11
The Good News About ASP 16
The Bad News About ASP 16
A New
Solution: ASP.NET 19
Conclusion
20
2 Managed Code and the Common
Language Runtime 21
Overview
of the .NET Framework 22
Introduction
to Microsoft Intermediate Language 24
Getting
the JITters—Just in Time! 30
Managed
Code and Data 31
About
Unsafe Code 33
Conclusion
33
3 The .NET Framework Objects
and Languages 35
The .NET
Solution to Type Compatibility 37
Value Types 38
Reference Types 40
Built-In Reference Types 41
Other
Objects in the .NET Framework 45
Overview
of Visual Basic .NET 47
Out with the Old! 47
In with the New! 50
C# (C
Sharp) Overview 57
Differences Between C++ and C# 58
Things You Can Do in C# but Not in Visual Basic .NET 60
Conclusion
64
4 ASP.NET Development 101
65
Hello
ASP.NET World! 65
A C# Example 66
A Visual Basic .NET Example 69
The ASP.NET
Development Model 71
Creating
an ASP.NET Web Application with Visual Studio .NET 72
Visual Studio .NET Interactions with Internet Information Services (IIS)
75
Your First Visual Studio .NET Web Page 76
Other
Types of ASP.NET Applications 81
XML Web Services 81
HTTP Handlers and HTTP Modules 84
Configuring
an Application 85
Where Does the Web.config File Go? 87
The authentication Section 88
The authorization Section 95
The customErrors Section 95
The httpHandlers Section 97
The httpModules Section 98
The identity Section 99
The pages Section 100
The processModel Section 101
The sessionState Section 104
The trace Section 105
Conclusion
108
5 Web Forms
109
Using
the Classic ASP Program Architecture 110
An Example of ASP.NET Form Validation 114
ASP.NET Server Controls vs. HTML Server Controls 117
Using
Validator Controls 118
The RequiredFieldValidator Control 119
The CompareValidator Control 124
Other Validators 129
Multiple Validators on a Single Field 138
The ValidationSummary Control 143
Maintaining
the State of Controls in ASP.NET 148
Manipulating
Server Controls Programmatically 152
Conclusion
164
6 Creating ASP.NET Components
165
The Trouble
with Components 165
ASP.NET
Control Classes 168
The Life
Cycle of a Control 170
Creating
User Controls 172
Preparing a Web Page to Be Converted to a User Control 172
Converting a Web Page to a User Control 176
Creating
Custom Controls 187
A Simple Custom Control 187
Creating Custom Controls in Visual Studio .NET 191
A More Complicated Custom Control 193
A Composite Custom Control 200
Installing a Control in Visual Studio .NET 205
Enhancing Design-Time Support 211
Conclusion
213
7 Balancing Server and Client
Functionality 215
Client-Side
Scripting 216
How ASP.NET Uses Client-Side Scripting 218
Firing Postbacks from a Custom Control 223
Creating
an Extensive Client-Side Web Control 228
Conclusion
240
8 Time to Get the Data!
241
XML as
the Universal Data Language 241
Current Solutions to Formatting Data vs. the XML Approach 242
Is XML Perfect? 244
Using
the IEnumerator Interface 244
Introducing
ADO.NET 249
ADO Overview 249
Differences Between ADO and ADO.NET 250
Using ADO.NET from ASP.NET 252
SqlClient vs. OleDb Classes 273
Generating XML from Data 274
Conclusion
277
9 Data and ASP.NET Forms
279
Accessing
Data Using ASP Forms 279
Accessing
Data Using ASP.NET Forms 282
The DataGrid
Server Control 282
Modifying a Data Grid Using the Visual Studio .NET Designer 284
Modifying a Data Grid Using Visual Basic .NET 290
The Repeater
Server Control 298
Repeater Control Basics 300
Creating
Data Entry Pages 310
Creating the User Interface 312
Processing Data Entry 320
Conclusion
332
10 XML Web Services
333
Standards
for XML Web Services 334
Creating
a Simple XML Web Service 336
Expanding and Testing the XML Web Service 337
Using WebMethod Attribute Properties 342
Consuming
a Simple XML Web Service 344
XML Web Services and Command-Line Tools 351
A Real-World
XML Web Service: Article Distribution 355
Security Options 355
Creating and Testing the XML Web Service 356
Consuming the XML Web Service 361
Possible Enhancements 364
Conclusion
366
APPENDIX A
Configuring ASP.NET Applications in IIS 367
ASP.NET
User Authentication 367
Creating
a New Virtual Directory in IIS 368
APPENDIX B
What You Need to Know About HTML to Use This Book 377
HTML
Tags 378
HTML
Links 378
HTML
Widgets 379
HTML
Tables 382
INDEX 387 |