Reduce Repetitive Code with ASP.NET Custom Controls (Page 1 of 6 )
One of the more useful features in ASP.NET is that you can make your own web controls by simply creating a class that inherits from any ASP.NET web control, such as the DropDownList or DataGrid.
Using this feature to create controls that automatically "grab" data can help ensure a consistent user interface and significantly reduce repetitive code.
Consider as an example a large web application where a standard drop down list must be displayed on several different pages.
Rather than create a DropDownList and all the code associated with populating it on every page, a developer could simply create a control that handles its own data access and data binding.
In this article I'll cover all you need to know about creating these controls and using them in your ASP.NET pages.