Design-Time Support for Web Forms
This section contains topics that describe how to implement designers for ASP.NET server controls. For background information about designer classes, see Custom Designers.
Terminology Note The terms Web Forms page and ASP.NET page are used interchangeably. The term Web Forms is generally applied to the design-time technology that enables the authoring of ASP.NET pages in a visual designer. The term Web server control refers to a class in the System.Web.UI.WebControls namespace.
ASP.NET provides the following base designer classes in the System.Web.UI.Design namespace:
- System.Web.UI.Design.ControlDesigner provides base design-time functionality for ASP.NET server controls.
- System.Web.UI.Design.ReadWriteControlDesigner derives from ControlDesigner and provides base design-time functionality for read/write server controls such as System.Web.UI.WebControls.Panel.
- System.Web.UI.Design.TemplatedControlDesigner derives from ControlDesigner and provides base design-time functionality for templated server controls such as System.Web.UI.WebControls.DataList.
Designer classes for the Web server controls derive directly or indirectly from these base classes and are in the System.Web.UI.Design.WebControls namespace. For example, System.Web.UI.Design.WebControls.ButtonDesigner is the designer for the System.Web.UI.WebControls.Button control, System.Web.UI.Design.WebControls.CalendarDesigner is the designer for the System.Web.UI.WebControls.Calendar control, and so on.
Note The following notes do not pertain to designer classes, but they are included here because they apply to overall design-time functionality in Web Forms:
- The Web Forms designer does not support the ShouldSerializePropertyName and ResetPropertyName methods that are optionally exposed by Windows Forms controls for property persistence. Server controls are serialized using methods provided by the ControlPersister class. The implementation of these methods is driven by metadata attributes such as DefaultValueAttribute, PersistenceModeAttribute, and DesignerSerializationVisibilityAttribute.
- If a control exposes properties that have subproperties (that is, properties whose types are classes that in turn expose properties), apply the NotifyParentPropertyAttribute to the subproperties if you want the parent property to receive notification of changes to the values of a subproperty.
In This Section
- Implementing a Simple Web Forms Control Designer
- Describes the key steps in implementing a designer that governs the design-time HTML rendered by an ASP.NET server control.
- Implementing a Web Forms Data-Bound Control Designer
- Describes how to implement a designer that provides design-time data binding for a data-bound control.
- Implementing a Web Forms Template Editor
- Describes how to implement a template editor for a templated ASP.NET server control.
- Web Forms Templated Data-Bound Control Designer Sample
- Provides a sample of a designer that enables template editing and design-time data binding for a templated data-bound control.
- Attributes and Design-Time Support
- Describes how custom attributes enable design-time support to be associated with a component or control.
- Design-Time Attributes for Components
- Lists the attributes that are commonly applied to properties and events in components and controls.
- Implementing a Type Converter
- Describes how to implement a type converter for a custom type.
- Implementing a UI Type Editor
- Describes how to implement a UI type editor that allows visual editing for a custom type.
- Custom Designers
- Describes how to implement a designer that governs the visual representation of a component at design time.