Using classes inherited from HtmlInput* as custom control

Discussion in 'ASP .Net' started by hiriumi@gmail.com, Feb 9, 2006.

  1. Guest

    I have an conversion issue from ASP .NET 1.1 to 2.0.

    I used to be able to create a class that inherits from any class under
    System.Web.UI.HtmlControls and register the namespace in which the
    class lives.

    In ASP .NET 2.0, the same principle is working if the classes inherit
    from System.Web.UI.WebControls.WebControl (or any class that inherits
    from WebControl class), but if the class inherits from classes under
    System.Web.UI.HtmlControls, I can't seem to use them as the custom tag.

    So what I want to do is... let's say I got a class that inherits from
    System.Web.UI.HtmlControls.HtmlInputButton and its class name is
    MyButtonControl. And the class belongs to MyWebApp namespace. Of
    course, MyButtonControl class has some custom code in it. And then, in
    one of the .aspx page, I would have the following.

    <% Register TagPrefix="MyControls" Namespace="MyWebApp" %>

    And then I should be able to use MyButtonControl like the following.

    <MyControls:MyButtonControl id="btnWhatever" runat="server" />

    What can I do to accomplish this in ASP .NET 2.0?
     
    , Feb 9, 2006
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sean Patterson

    HtmlInput "Security" Issue?

    Sean Patterson, Apr 29, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    354
    Sean Patterson
    Apr 29, 2004
  2. Newbie
    Replies:
    6
    Views:
    8,506
    Bob Barrows [MVP]
    Jan 24, 2005
  3. Mark Rae
    Replies:
    12
    Views:
    645
    Mark Rae
    Mar 8, 2005
  4. Anita C

    htmlinput-checkbox

    Anita C, Aug 25, 2003, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    108
    Rohit
    Aug 26, 2003
  5. Sara
    Replies:
    1
    Views:
    286
    Patrice
    Aug 8, 2005
Loading...

Share This Page