Why can't I make a custom control from System.Web.UI.HtmlControls.HtmlControl?

Discussion in 'ASP .Net Building Controls' started by Chris, Nov 6, 2003.

  1. Chris

    Chris Guest


    I make a custom control, inheriting from
    System.Web.UI.HtmlControls.HtmlControl as follows:
    public class MyControl : System.Web.UI.HtmlControls.HtmlControl
    // ...

    When I attempt to place it in my toolbox in VS, I get the message that
    there are no components in my assembly that can be placed on the
    toolbox. When I make a simple change to inherit from
    System.Web.UI.WebControls.WebControl, I can add the control without a
    problem, as follows:
    public class MyControl : System.Web.UI.WebControls.WebControl
    // ...

    This control does not need to incur the overhead of a WebControl, so
    I'd like to make it a "simpler" HtmlControl. Am I missing something?
    Can I not use a HtmlControl in the VS.NET toolbox? Is this the wrong
    control from which to inherit?
    Chris, Nov 6, 2003
    1. Advertisements

  2. Nevermind. I see VS.NET does not allow it.
    Chris Simmons, Nov 6, 2003
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Similar Threads
There are no similar threads yet.