ModulePage.ShowError Method

Definition

Displays an error message box that is parented to the top-most window.

Overloads

ShowError(Exception, Boolean)

Displays an error message box that is parented to the top-most window, using the specified exception and warning status.

ShowError(Exception, String, Boolean, String)

Displays an error message box that is parented to the top-most window, using the specified exception, message, warning status, and caption.

ShowError(Exception, String, Boolean)

Displays an error message box that is parented to the top-most window, using the specified exception, message, and warning status.

ShowError(String, Boolean)

Displays an error message box that is parented to the top-most window, using the specified message and warning status.

ShowError(Exception, Boolean)

Displays an error message box that is parented to the top-most window, using the specified exception and warning status.

protected:
 void ShowError(Exception ^ exception, bool isWarning);
protected void ShowError (Exception exception, bool isWarning);
member this.ShowError : Exception * bool -> unit

Parameters

exception
Exception

The Exception object that provides the message.

isWarning
Boolean

true to display a warning icon; false to display an error icon.

Examples

The following example uses this method to display exceptions.

try {
    myTaskX();
} catch (Exception ex) {
    ShowError(ex, true);
} 

Remarks

If isWarning is true, a warning icon is displayed; otherwise, an error icon is displayed. The System.Exception.Message property supplies the text of the exception message. The dialog box caption is the title parameter from the Microsoft.Web.Management.Client.ModulePageInfo.ModulePageInfo constructor.

Applies to

ShowError(Exception, String, Boolean, String)

Displays an error message box that is parented to the top-most window, using the specified exception, message, warning status, and caption.

protected:
 void ShowError(Exception ^ exception, System::String ^ message, bool isWarning, System::String ^ caption);
protected void ShowError (Exception exception, string message, bool isWarning, string caption);
member this.ShowError : Exception * string * bool * string -> unit

Parameters

exception
Exception

The Exception object that provides the message.

message
String

An additional message to display.

isWarning
Boolean

true to display a warning icon; false to display an error icon.

caption
String

The caption for the title bar.

Examples

The following example uses this method to display exceptions.

try {
    myTaskX();
} catch (Exception ex) {
    ShowError(ex, "My Message", true, "My Caption");
}

Remarks

If isWarning is true, a warning icon is displayed; otherwise, an error icon is displayed. The System.Exception.Message property supplies the primary text of the exception message, which is followed by the message parameter string.

Applies to

ShowError(Exception, String, Boolean)

Displays an error message box that is parented to the top-most window, using the specified exception, message, and warning status.

protected:
 void ShowError(Exception ^ exception, System::String ^ message, bool isWarning);
protected void ShowError (Exception exception, string message, bool isWarning);
member this.ShowError : Exception * string * bool -> unit

Parameters

exception
Exception

The Exception object that provides the message.

message
String

An additional message to display.

isWarning
Boolean

true to display a warning icon; false to display an error icon.

Examples

The following example uses this method to display exceptions.

try {
    myTaskX();
} catch (Exception ex) {
    ShowError(ex, "My Message", false);
}

Remarks

If isWarning is true, a warning icon is displayed; otherwise, an error icon is displayed. The System.Exception.Message property supplies the primary text of the exception message, which is followed by the message parameter string. The dialog box caption is the title parameter from the Microsoft.Web.Management.Client.ModulePageInfo.ModulePageInfo constructor.

Applies to

ShowError(String, Boolean)

Displays an error message box that is parented to the top-most window, using the specified message and warning status.

protected:
 void ShowError(System::String ^ message, bool isWarning);
protected void ShowError (string message, bool isWarning);
member this.ShowError : string * bool -> unit
Protected Sub ShowError (message As String, isWarning As Boolean)

Parameters

message
String

The message to display in the dialog box.

isWarning
Boolean

true to display a warning icon; false to display an error icon.

Examples

The following example uses this method to display an error message.

       ShowError("My Error Msg", 
                  false    // true to Show warning
                );       // false to show Error

Remarks

If isWarning is true, a warning icon is displayed; otherwise, an error icon is displayed. The dialog box caption is the title parameter from the Microsoft.Web.Management.Client.ModulePageInfo.ModulePageInfo constructor.

Applies to