How do you create a custom control (not an ASCX control) and, more importantly, use it in your project? I\'d prefer not to create a separate project for it or compile it as
You mentioned that you wanted to avoid creating a separate project. As the other responses have indicated, it is far more common to simply create a new project to store your custom controls and reference it. It is possible, however, to register a control defined in the same project, using the regular syntax:
<%@ Register TagPrefix="Example" Namespace="CustomControls" Assembly="CustomControls" %>
Where the "Assembly" is the assembly where both the control and the page is located. This works much easier if you are using a Web Application Project, rather than a Web Site.