System.Web.UI.Control Class

Defines the properties, methods, and events that are shared by all ASP.NET server controls.

See Also: Control Members

Syntax

[System.Web.UI.Themeable(false)]
[System.ComponentModel.Bindable(true)]
[System.ComponentModel.Design.Serialization.DesignerSerializer("Microsoft.VisualStudio.Web.WebForms.ControlCodeDomSerializer, Microsoft.VisualStudio.Web, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", "System.ComponentModel.Design.Serialization.CodeDomSerializer, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
[System.ComponentModel.Designer("System.Web.UI.Design.ControlDesigner, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", "System.ComponentModel.Design.IDesigner")]
[System.ComponentModel.ToolboxItem("System.Web.UI.Design.WebControlToolboxItem, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
[System.ComponentModel.ToolboxItemFilter("System.Web.UI", System.ComponentModel.ToolboxItemFilterType.Require)]
[System.ComponentModel.DesignerCategory("Code")]
[System.ComponentModel.DefaultProperty("ID")]
public class Control : System.ComponentModel.IComponent, IControlBuilderAccessor, IControlDesignerAccessor, IDataBindingsAccessor, IExpressionsAccessor, IParserAccessor, IUrlResolutionService

Remarks

This is the primary class that you derive from when you develop custom ASP.NET server controls. System.Web.UI.Control does not have any user interface (UI) specific features. If you are authoring a control that does not have a UI, or combines other controls that render their own UI, derive from System.Web.UI.Control. If you are authoring a control that does have a UI, derive from System.Web.UI.WebControls.WebControl or any control in the System.Web.UI.WebControls namespace that provides an appropriate starting point for your custom control.

The System.Web.UI.Control class is the base class for all ASP.NET server controls, including custom controls, user controls, and pages. ASP.NET pages are instances of the System.Web.UI.Page class, which inherits from the System.Web.UI.Control class, and that handle requests for files that have an .aspx extension.

The System.Web.UI.Control class can directly or indirectly be used as part of the user interface for your Web application, and as such should be scrutinized to make sure best practices for writing secure code and securing applications are followed.

For general information on these topics, see Overview of Web Application Security Threats, Security Policy Best Practices, and Key Security Concepts. For more specific information, see Securing Standard Controls, How to: Display Safe Error Messages, How to: Protect Against Script Exploits in a Web Application by Applying HTML Encoding to Strings, and Introduction to the Validation Controls.

Requirements

Namespace: System.Web.UI
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0