ErrorDisplayModel Class
An error display component that allows rich rendering of individual messages as well as validation error messages.
Object should be passed in to view end rendered with <%= ((ErrorDisplay) ViewData["ErrorDisplay"]).Show(450,true) %> or via a view.
Relies on several CSS Styles: .errordisplay, errordisplay-text, errordisplay-warning-icon, errordisplay-info-icon The icon links link to images.
Westwind.AspNetCore.Components.ErrorDisplayModel
Class Members
| Member | Description | |
|---|---|---|
| Constructor | ||
| AddMessage | Adds an individual model error
public void AddMessage(string errorMessage, string control)
|
|
| AddMessages | Adds an existing set of Validation Errors to the DisplayErrors
public void AddMessages(IEnumerable
public void AddMessages(ValidationErrorCollection validationErrors, string fieldPrefix)
|
|
| FromRequest | Tries to populate the error display object from the requestobject's Query and Form Variables.Variables:error-message, error-icon, error-class
public void FromRequest(HttpRequest request)
|
|
| ShowError |
public void ShowError(string errorMessage, string header)
|
|
| ShowInfo |
public void ShowInfo(string message, string header)
|
|
| ShowSuccess |
public void ShowSuccess(string message, string header)
|
|
| ShowWarning |
public void ShowWarning(string errorMessage, string header)
|
|
| ToString |
public string ToString()
|
|
| AlertClass | ||
| Dismissable | Determines whether the alert can be closed | |
| DisplayErrors | Holds a modelstate errors collection | |
| HasMessage | Determines whether there is a message present. | |
| Header | ||
| HeaderAsRawHtml | Flag that determines whether the message is displayedas HTML or as text. By default message is encoded as text (false). | |
| Icon | Name of an font-awesome icon to display'warning', 'error', 'info', 'success' have specialmeaning and display custom colors | |
| Message | The message that is displayed | |
| MessageAsRawHtml | Flag that determines whether the message is displayedas HTML or as text. By default message is encoded as text (false). | |
| Timeout | Timeout in milliseconds before the error display is hidden | |
Assembly: Westwind.AspNetCore.dll
© West Wind Technologies, 2025 • Updated: 2025-03-08
Comment or report problem with topic
