O'Reilly logo

ASP.NET by Example by Steven A. Smith

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Building On Existing Controls

By overriding the Render() method of the base Control class, you can build very powerful controls. However, often you will find that there is an existing control that has most of the functionality you need. In this case, it is often much more efficient to simply inherit from the control that has most of your functionality. A common example of this kind of control would be a DropDownList that you would like to have pre-populated. Consider a form that has many yes or no questions on it. You might want to have a DropDownList with options for Yes, No, and a blank default option. You could create a custom control from scratch with this functionality, but you would not have any of the built-in functionality of the DropDownList ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required