ExpressionEditor.GetExpressionEditor Method (String, IServiceProvider)


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Returns an ExpressionEditor implementation that is associated with the specified expression prefix.

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

public static ExpressionEditor GetExpressionEditor(
	string expressionPrefix,
	IServiceProvider serviceProvider


Type: System.String

The expression prefix used to find the associated expression editor.

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.ExpressionEditor

An ExpressionEditor implementation associated with expressionPrefix; otherwise, null, if expressionPrefix is not defined or is not associated with an ExpressionEditor.

Exception Condition

serviceProvider is null.

Use the static GetExpressionEditor method overloads to find the ExpressionEditor object that is associated with a particular expression prefix or expression builder type.

For each custom expression type, an expression prefix identifies the associated expression builder and expression editor. When custom expressions are parsed in a page, the expression prefix is used to create instances of the associated ExpressionBuilder and ExpressionEditor classes.

To associate an expression prefix with an expression builder and expression editor, apply the ExpressionEditorAttribute and ExpressionPrefixAttribute attributes to the custom ExpressionBuilder class and configure the expression prefix for an expression builder in the expressionBuilders element in the Web configuration file.

To find the associated expression editor for an expression prefix, the GetExpressionEditor method enumerates the available ExpressionBuilder implementations for a matching prefix. The ExpressionBuilder implementations can be configured in the expressionBuilders section of the Web configuration file. If an available ExpressionBuilder implementation defines the expression prefix, the GetExpressionEditor method returns the type that is specified in the ExpressionEditorAttribute attribute of the ExpressionBuilder metadata.

.NET Framework
Available since 2.0
Return to top