Change the name of originating error source after an exception occurred, for example another name for a property.

Namespace:  EPiServer.Core
Assembly:  EPiServer (in EPiServer.dll) Version: 5.2.375.236

Syntax

C#
void ChangeDisplayName(
	string displayName
)

Parameters

displayName
Type: System..::.String
The new name to be used

Remarks

Properties will by default throw their own data type as originator because validation is often done in static methods on postbacks.

Examples

Change name of source after catching an exception
CopyC#
PropertyString prop = new PropertyString();
prop.IsRequired = true;
try
{
    prop.Clear();
}
catch (RequiredPropertyValueException e)
{
    e.ChangeDisplayName("Footer");
    throw e;
}

See Also