
118
This is the Title of the Book, eMatter Edition
Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.
Chapter 6User and Server Controls
6
User Controls and
Custom Server Controls
Reuse, a technique that is important to most developers, allows you to avoid
constantly reinventing the wheel by using functionality that has already been built
and tested. Reuse 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. Of
course, the framework classes provide built-in functionality more than reuse.
Fortunately, the framework also provides robust support for developing your own
classes, user controls, and custom server controls, allowing you to reuse your own
code as well.
Going hand-in-hand with reuse is the concept of extensibility ...