First: initial knowledge of ASP. NET control Development _ Section I: Control classes and their inheritance relationships

Source: Internet
Author: User

1) System.Web.UI.Control (hereinafter referred to as Control )

The control class is the base class for all the ASP. NET server controls, including custom controls, user controls, and pages ... Defines the properties, methods, and events that are shared by all ASP.

namespaces: System.Web.UI
Assemblies: System.Web (in System.Web.dll)

2) System.Web.UI.WebControls.WebControl (hereinafter referred to as WebControl)

The WebControl class is the base class for all the controls in the System.Web.UI.WebControls namespace: It derives from the control class, which defines common properties, methods, and events that are shared by all Web server controls. (MSDN).

But the anti-compilation literal learned that the literal control is directly derived in the System.Web.UI.WebControls namespace from the control class. See

namespaces: System.Web.UI.WebControls
Assemblies: System.Web (in System.Web.dll)

3) System.Web.UI.WebControls. CompositeControl (hereinafter referred to AS CompositeControl )

The CompositeControl class is an abstract class derived from WebControls that implements the basic functionality required for a Web control that contains child controls.

namespaces: System.Web.UI.WebControls
Assemblies: System.Web (in System.Web.dll)

    • Control, WebControl, the inheritance relationship between CompositeControl
      • System.Object
      • System.Web.UI.Control
      • System.Web.UI.WebControls.WebControl
      • System.Web.UI.WebControls.CompositeControl
When you develop a control, the base class is selected:

1) First, ASP. NET all the standard controls can be used to do the base class, so if the control to be implemented is only a small number of modifications or additions to a standard control, then large can be the standard control to do the base class.

2) When the control to be implemented cannot find a suitable prototype in a standard control, consider the control, WebControl, CompositeControl three base classes. (The choice of the specific base class is shown)

First: initial knowledge of ASP. NET control Development-section I: Control classes and their inheritance relationships

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.