ErrorWebPart.ErrorMessage Property

Note: This property is new in the .NET Framework version 2.0.

Gets or sets the error message that is displayed in a Web page in place of a control that could not be successfully added to the page.

Namespace: System.Web.UI.WebControls.WebParts
Assembly: System.Web (in system.web.dll)

public:
property String^ ErrorMessage {
	String^ get ();
	void set (String^ value);
}
/** @property */
public String get_ErrorMessage ()

/** @property */
public void set_ErrorMessage (String value)

public function get ErrorMessage () : String

public function set ErrorMessage (value : String)

Property Value

A string that contains the text of the error message. The default value is a culture-specific error message.

The ErrorMessage property can be assigned a value by a developer, so that a custom error message is displayed at the point where the ErrorWebPart control is inserted into a page.

Notes to Inheritors Developers can assign a default value to the ErrorMessage property by extending the ErrorWebPart class and, in the ErrorWebPart constructor or in an overridden EndLoadPersonalization method, assigning a default value to the property. To require the WebPartManager control to use a custom ErrorWebPart control, you must also inherit from the WebPartManager class and override its CreateErrorWebPart method. In that method, you should assign the value of the method's errorMessage parameter to the ErrorMessage property of your custom ErrorWebPart control, because the WebPartManager control calls this method from several other places, and usually passes in a specific error message.

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

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

.NET Framework

Supported in: 2.0

Community Additions

ADD
Show: