WebPart.ImportErrorMessage Property

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

Gets or sets an error message that is used if errors occur when a WebPart control is imported.

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

[LocalizableAttribute(true)] 
public:
virtual property String^ ImportErrorMessage {
	String^ get ();
	void set (String^ value);
}
/** @property */
public String get_ImportErrorMessage ()

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

public function get ImportErrorMessage () : String

public function set ImportErrorMessage (value : String)

Property Value

A string that contains the error message. The default value is a standard error message supplied by the Web Parts control set.

The ImportErrorMessage property allows you to set a custom error message that is displayed if an error occurs when a user tries to import a part control's description file into a catalog of Web Parts controls. You can set the property declaratively on a WebPart control, adding the ImportErrorMessage attribute within the opening tag of the control and assigning an error message string to it. You can also set the property value programmatically.

For a full code example that demonstrates both exporting and importing .WebPart description files for WebPart controls, which includes use of the ImportErrorMessage property, see the ImportCatalogPart class.

The value of this property, when set, can be saved automatically to a resource file by using a designer tool. For more information, see LocalizableAttribute and ASP.NET Globalization and Localization.

The personalization scope of this property is set to Shared and can be modified only by authorized users. For more information, see PersonalizableAttribute and Web Parts Personalization Overview.

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: