Custom Controls Defined

I l @ ve RuBoard

We've seen quite a variety of controls so far in this book, and in this chapter we're adding one more: custom controls. However, we're going to also look at components at the end of the chapter, so it would help if we had a good understanding of just what a control is, compared to a component, or even just a simple class.

According to the .NET documentation, a control is defined as any object that is derived, either directly or indirectly, from the System.Web.UI. Control class. All the controls discussed in earlier chapters derive from this class at some point in their hierarchy. Apart from this distinction, the primary difference between a control, and any other custom piece of functionality, is that it renders User Interface (UI) logic. A component, on the other hand, is an object that performs some behind-the-scenes logic for an application but is not a part of the application's UI. One common type of component retrieves data from a database; these are typically referred to as data access components. Finally, a class is simply a blueprint for an object, and in the .NET world, both controls and components are built using classes.

All the samples in this chapter are in C#. The VB.NET versions of the samples can be viewed at

I l @ ve RuBoard

Asp. Net. By Example
ASP.NET by Example
ISBN: 0789725622
EAN: 2147483647
Year: 2001
Pages: 154

Similar book on Amazon © 2008-2017.
If you may any questions please contact us: