This documentation is archived and is not being maintained.

ExpressionEditor.GetExpressionEditorSheet Method

Returns an expression editor sheet that is associated with the current expression editor.

Namespace:  System.Web.UI.Design
Assembly:  System.Design (in System.Design.dll)

public virtual ExpressionEditorSheet GetExpressionEditorSheet(
	string expression,
	IServiceProvider serviceProvider


Type: System.String

The expression string set for a control property, used to initialize the expression editor sheet.

Type: System.IServiceProvider

A service provider implementation supplied by the designer host, used to obtain additional design-time services.

Return Value

Type: System.Web.UI.Design.ExpressionEditorSheet
An ExpressionEditorSheet that defines the custom expression properties.

The GetExpressionEditorSheet method returns an ExpressionEditorSheet implementation that defines the strings that are combined to form a custom expression. The visual designer uses an expression editor sheet to prompt for one or more strings that combine into a custom expression. The base class method returns a default expression editor sheet, which uses a single input string to form the expression. The expression editor sheet defines the property grid for the expression. Therefore, the properties that the expression editor exposes become properties that can be defined for the expression in the dialog box.

Classes deriving from the ExpressionEditor class optionally can override the GetExpressionEditorSheet method to provide a custom expression editor sheet. A custom expression editor sheet can allow design-time input for multiple properties, which are combined together to form the expression string.

For example, the ResourceExpressionEditor class derives from the ExpressionEditor class and provides an implementation for evaluating and associating a resource string reference with a control property at design time. The ResourceExpressionBuilder class is associated with the expression prefix Resources and the ResourceExpressionEditor implementation. The ResourceExpressionEditor.GetExpressionEditorSheet method returns a ResourceExpressionEditorSheet, which defines the individual properties that form a resource reference expression.

Notes to Inheritors:

Typically, to supply a new expression type at design time, you define a unique expression prefix and provide custom ExpressionBuilder and ExpressionEditor implementations. Optionally, you can provide a custom ExpressionEditorSheet implementation that defines properties that are used to form the expression. Even though the configuration file defines the prefix, you should also apply an ExpressionPrefixAttribute object and an ExpressionEditorAttribute object.

Override the GetExpressionEditorSheet method to return an expression editor sheet that defines design-time input for multiple properties in a custom expression. When you select a control property and the expression editor type, the visual designer calls the GetExpressionEditorSheet method, and then supplies the current expression string that is set for the control property. Use expression to set the initial values for the expression properties. Use serviceProvider to initialize a custom expression sheet constructor and to access services that are provided by the designer host. For example, call the GetService method with the IWebApplication type to access project items, documents, or configuration file details that are provided through the visual designer.

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0, 2.0