Inheriting From System.Web.UI.Control

Discussion in 'ASP .Net Web Controls' started by Ron Vecchi, Oct 20, 2003.

  1. Ron Vecchi

    Ron Vecchi Guest

    I am creating a custom control, and pretty green at it too. Now if I
    inherit from WebControl I have a bunch of inherited properties that I don't
    need and don't care to implement.
    So Is there any problems with Inheriting from Control instead of WebControl.
    Is designer support still available at design time?

    Thanks,
    Ron Vecchi
     
    Ron Vecchi, Oct 20, 2003
    #1
    1. Advertising

  2. Ron Vecchi

    Alvin Bruney Guest

    That is a very suspect approach.

    Rather than focussing on what you don't want to implement, you should be
    targetting the environment in which the control will be placed. With that
    approach, you would choose to inherit from webcontrols if your user control
    were to run in a webcontrol environment because this control is optimized
    for the environment.

    If you don't want the properties, or don't care to implement them, just
    ignore them or don't implement them. Either way, the inheritance heirarchy
    pretty much dictates that you get all the functionality whether you want it
    or not, or whether or not you choose to implement them.

    regards

    --


    -----------
    Got TidBits?
    Get it here: www.networkip.net/tidbits/default.htm

    "Ron Vecchi" <> wrote in message
    news:#...
    > I am creating a custom control, and pretty green at it too. Now if I
    > inherit from WebControl I have a bunch of inherited properties that I

    don't
    > need and don't care to implement.
    > So Is there any problems with Inheriting from Control instead of

    WebControl.
    > Is designer support still available at design time?
    >
    > Thanks,
    > Ron Vecchi
    >
    >
     
    Alvin Bruney, Oct 21, 2003
    #2
    1. Advertising

  3. Hi Ron,

    In ASP.NET world, there are two base classes for us to author our own
    custom controls. One is System.Web.UI.Control, the other is
    System.Web.UI.WebControls.WebControl. there are almost same, except that if
    we are authoring a control that does not provide UI, or one that combines
    other controls that render their own UI, derive from Control. Our custom
    control renders UI, derive from WebControl.

    Please check the URL below for more details,
    http://msdn.microsoft.com/library/en-us/cpguide/html/cpconkeyconceptsinwebfo
    rmscontroldevelopment.asp?frame=true

    Of course, design-time supports are available in both cases. This article
    may be helpful for you,

    http://www.intertech-inc.com/DOWNLOADS/presentations/designtimetalk.pdf

    Does it answer your question? If I have misunderstood your concern, please
    feel free to let me know.

    Best regards,

    Jacob Yang
    Microsoft Online Partner Support
    Get Secure! ¨C www.microsoft.com/security
    This posting is provided "as is" with no warranties and confers no rights.
     
    Jacob Yang [MSFT], Oct 21, 2003
    #3
  4. Ron Vecchi

    Ron Vecchi Guest

    That helps, Thanks
    "Jacob Yang [MSFT]" <> wrote in message
    news:...
    > Hi Ron,
    >
    > In ASP.NET world, there are two base classes for us to author our own
    > custom controls. One is System.Web.UI.Control, the other is
    > System.Web.UI.WebControls.WebControl. there are almost same, except that

    if
    > we are authoring a control that does not provide UI, or one that combines
    > other controls that render their own UI, derive from Control. Our custom
    > control renders UI, derive from WebControl.
    >
    > Please check the URL below for more details,
    >

    http://msdn.microsoft.com/library/en-us/cpguide/html/cpconkeyconceptsinwebfo
    > rmscontroldevelopment.asp?frame=true
    >
    > Of course, design-time supports are available in both cases. This article
    > may be helpful for you,
    >
    > http://www.intertech-inc.com/DOWNLOADS/presentations/designtimetalk.pdf
    >
    > Does it answer your question? If I have misunderstood your concern, please
    > feel free to let me know.
    >
    > Best regards,
    >
    > Jacob Yang
    > Microsoft Online Partner Support
    > Get Secure! ¨C www.microsoft.com/security
    > This posting is provided "as is" with no warranties and confers no rights.
    >
     
    Ron Vecchi, Oct 21, 2003
    #4
    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. DanG
    Replies:
    4
    Views:
    9,637
  2. Andy B
    Replies:
    2
    Views:
    3,173
    Andy B
    Apr 23, 2008
  3. Nathan Sokalski
    Replies:
    1
    Views:
    539
    Nathan Sokalski
    Jul 31, 2009
  4. Jimmy [Used-Disks]

    Inheriting from System.Web.UI.WebControls.Table

    Jimmy [Used-Disks], Aug 14, 2003, in forum: ASP .Net Building Controls
    Replies:
    1
    Views:
    222
    Jimmy [Used-Disks]
    Aug 14, 2003
  5. Nathan Sokalski

    Inheriting System.Web.UI.WebControls.Image and RenderContents

    Nathan Sokalski, Jul 29, 2009, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    788
    Nathan Sokalski
    Jul 31, 2009
Loading...

Share This Page