Extending Built-In Web Controls - ASP.NET

{outline|||Step <1> - }

Overview

Although you can create a server control within its own project, sometimes you just want to extend a built-in ASP.NET web control for a single website. Here's how.

Walkthrough

Create Extender Class


Configure Your Website


<system.web>
  <pages>
    <controls>
      <add tagPrefix="tag" namespace="namespace" />
      ...
    </controls>
  </pages>
<system.web>

Implement your Control

You can reference the new control in your ASPX code as follows.


<tag:className runat="server" ... />