System.Web.UI.Design.ExpressionEditor Class

Defines a set of properties and methods for evaluating an expression that is associated with a control property at design time and to provide an expression editor sheet to the visual design host for use in the expression editor dialog box. This class is abstract.

See Also: ExpressionEditor Members


public abstract class ExpressionEditor


A visual designer host, such as vsprvslong, uses the System.Web.UI.Design.ExpressionEditor class to present custom expression editor sheets to the user, and then evaluate the selected expression for design-time rendering.

When you browse the HtmlControlDesigner.Expressions property for a control in the design-time Properties grid, the visual designer displays a dialog box to set expressions for a control property. You can select the expression type based on a list of expression prefixes. When you select an expression prefix from the list, the visual designer uses the associated System.Web.UI.Design.ExpressionEditor and System.Web.UI.Design.ExpressionEditorSheet objects to set, evaluate, and convert the expression string based on the syntax for that type of expression. The visual designer sets the expression for the associated control property, and then uses the evaluated expression result to assign control property values that are rendered on the design surface.

The static erload:System.Web.UI.Design.ExpressionEditor.GetExpressionEditor methods get the expression editor that is associated with a particular expression prefix or expression builder. The ExpressionEditor.ExpressionPrefix property for an System.Web.UI.Design.ExpressionEditor object returns the configured expression prefix. The ExpressionEditor.EvaluateExpression(string, object, Type, IServiceProvider) method evaluates an input expression string. The ExpressionEditor.GetExpressionEditorSheet(string, IServiceProvider) method returns the System.Web.UI.Design.ExpressionEditorSheet implementation that is used to prompt for the custom expression properties in the expressions dialog box.

Typically, to support a new expression type at design time, you define a unique expression prefix and provide custom System.Web.Compilation.ExpressionBuilder and System.Web.UI.Design.ExpressionEditor implementations. Optionally, you can provide a custom System.Web.UI.Design.ExpressionEditorSheet implementation that defines properties that are used to form the expression in the expressions dialog box.

The expression prefix identifies the custom expression type and associates an expression with the expression builder and expression editor. When custom expressions are parsed in a page, the expression prefix is used to create instances of the associated System.Web.Compilation.ExpressionBuilder and System.Web.UI.Design.ExpressionEditor classes. To associate an expression prefix with an expression builder and expression editor, apply the System.Web.Compilation.ExpressionEditorAttribute and System.Web.Compilation.ExpressionPrefixAttribute attributes to the custom System.Web.Compilation.ExpressionBuilder class and configure the expression prefix for an expression builder in the expressionBuilders element in the Web configuration file. The prefix is not required, but highly recommended.


Namespace: System.Web.UI.Design
Assembly: System.Design (in System.Design.dll)
Assembly Versions:
Since: .NET 2.0