ASP.NET in a Nutshell
August 2, 2002
|
As a quick reference and tutorial in one, ASP.NET in a Nutshell
goes beyond the published documentation to highlight little-known
details, stress practical uses for particular features, and
provide real-world examples that show how features can be used in
a working application. This book covers application and web
service development, custom controls, data access, security,
deployment, and error handling. There’s also an overview of
web-related class libraries.
|
ASP.NET is the next generation of Active Server Pages from Microsoft. More than a mere upgrade, it’s designed to support the development of dynamic and data-driven web applications and web services in much the same way Visual Basic enabled the rapid development of Microsoft® Windows® desktop applications.
For those experienced with previous versions of ASP or the .NET platform, ASP.NET in a Nutshell is an invaluable resource that goes beyond the published documentation to highlight little-known details, stress practical uses for particular features, and provide real-world examples that show how features can be used in a working application.
Unlike other books, it distills what is a large and comparatively complicated subject into a tutorial and reference that is useful for both learning essential concepts and daily reference. This book covers
application and web service development, custom controls, data access, security, deployment, and error handling. There’s also an overview of the web-related namespaces in the .NET Framework Class Library.
Like other books in the "In a Nutshell" series, ASP.NET in a Nutshell offers the facts, including critical background information, in a no-nonsense manner that users will refer to again and again. It is a detailed reference that enables even experienced web developers to advance their ASP.NET
applications to new levels.
Chapter 6 User Controls and
Custom Server Controls
Reuse is a technique that is important to most
developers. Reuse allows you to avoid constantly reinventing the wheel by
using functionality that has already been built and tested. It increases
productivity, by reducing the total amount of code you need to write, and
reliability, since by using tested code, you (presumably) already know the
code works reliably.
ASP.NET provides a range of options for reuse. The first is the
wide variety of built-in server controls that ship with ASP.NET. These server
controls alone can eliminate hundreds, or even thousands, of lines of code
that needed to be written to achieve the same effect in classic ASP. In
addition, the .NET Framework Class Library (FCL) provides hundreds of classes
to perform actions (such as sending SMTP email or making network calls) that
in classic ASP would have required purchasing a third-party component or
making calls into the Win32 API.
Going hand-in-hand with reuse is the concept of
extensibility, the ability to take the existing functionality provided
by the .NET Framework and ASP.NET and extend it to perform actions that are
more tailored to your particular applications and problem domains. ASP.NET
provides a significant number of avenues for extensibility:
- Custom server controls
- Allow you to create entirely new controls for use
with ASP.NET or to derive from existing controls and extend or modify their
functionality.
- Components
- As in classic ASP, components are the primary means
for extending an ASP.NET application by encapsulating the application's
business logic into an easily reusable form. With the .NET Framework, it's
easier than ever to build components, and components are more interoperable
across languages than in the COM world. .NET components can also communicate
with COM components through an interoperability layer.
- HttpHandlers and HttpModules
- HttpHandlers are components that are called to
perform the processing of specific types of requests made to IIS.
HttpModules are components that participate in the processing pipeline of
all requests for a given ASP.NET application. These extensibility techniques
are beyond the scope of this book, but you can get answers to questions on
these topics at http://www.aspfriends.com/aspfriends/aspnghttphandlers.asp.
The rest of this chapter discusses employing ASP.NET user
controls and custom server controls for reuse and employing custom server
controls for extensibility. The chapter also explains how custom server
controls can easily be shared across multiple applications, making reuse
simpler than ever.
ASP.NET in a Nutshell
User Controls - Page 2
|