---
title: Display a status message
summary: Display a status/validation message with an icon selected from message-text keywords.
status: draft
owner: SAIF Doc Gen
last_reviewed: 2026-08-17
library: SAIF.Presentation.Web.Controls.V2
reference_type: package
operation_id: OP-V2-006
trigger: ASP.NET page lifecycle (`Init`, `CreateChildControls`, `RenderControl`) for a `SAIFMessage` instance.
---

# Display a status message

Display a status/validation message with an icon selected from message-text keywords. ASP.NET page lifecycle (`Init`, `CreateChildControls`, `RenderControl`) for a `SAIFMessage` instance.

| Field | Value |
| --- | --- |
| **Operation ID** | OP-V2-006 |
| **Trigger** | ASP.NET page lifecycle (`Init`, `CreateChildControls`, `RenderControl`) for a `SAIFMessage` instance. |
| **Inputs** | `Text`, `DisplayImage` (`SAIFMessage.Images`). |
| **Outputs** | A one-row HTML table containing a status icon and a label. |
| **Primary components** | `SAIFMessage` |
| **Entry point** | `SAIF.Presentation.Web.Controls.V2/SAIFMessage.vb` |

## Steps

1. On `Init`, register the `Message.js` client script include from `/Resources/Scripts/Controls/Message.js` unless already registered. ([BR-V2-037](../business-rules.md#br-v2-037-messagejs-included-once-per-page))
2. On `CreateChildControls`, add the message image (`SAIFMessageImage`) and the message label (`lblSAIFMessage`, CSS class `saifmsg`), marking the image as not enableable by the control manager via `Utilities.SetControlManagerEnableable`. ([BR-V2-038](../business-rules.md#br-v2-038-message-control-is-always-image-plus-label), [BR-V2-039](../business-rules.md#br-v2-039-message-image-excluded-from-bulk-enabledisable))
   - > **Origin**: This step delegates to `Utilities.mdlUtilities.SetControlManagerEnableable` (this library, see [Control-manager enableability helpers](control-manager-enableability-helpers.md)).
3. On `RenderControl`, emit a one-row table; in design mode force the "complete" icon. ([BR-V2-040](../business-rules.md#br-v2-040-design-mode-always-shows-the-complete-icon))
4. At run time, add attribute `IsImageSet=false` and a hidden display style when the text is empty, otherwise `IsImageSet=true`, then select the icon. ([BR-V2-041](../business-rules.md#br-v2-041-empty-message-hides-and-flags-isimagesetfalse))
5. Icon selection: if `DisplayImage` is `DefaultImage`, choose `MsgError.png` for text containing `error:`, `MsgWarning.png` for `warning:`, the complete image for `complete:`, `MsgComplete.png` for the exact text `changes saved.`, and `MsgWarning.png` otherwise; then strip all `complete:` occurrences from the text. ([BR-V2-042](../business-rules.md#br-v2-042-error-keyword-selects-the-error-icon), [BR-V2-043](../business-rules.md#br-v2-043-warning-keyword-or-unmatched-text-selects-the-warning-icon), [BR-V2-044](../business-rules.md#br-v2-044-complete-keyword-or-fixed-phrase-selects-the-complete-icon), [BR-V2-045](../business-rules.md#br-v2-045-complete-keyword-stripped-from-displayed-text), [BR-V2-046](../business-rules.md#br-v2-046-explicit-displayimage-skips-keyword-classification))
6. Render image, label and closing tags.
   - On failure: write the exception message, source and stack trace to the output stream.

## Process flow

The following diagram visualizes this operation's control flow.

```mermaid
flowchart TD
	Start([RenderControl]) --> Design{Design mode?}
	Design -->|Yes| Complete[Force complete icon]
	Design -->|No| Empty{Text empty?}
	Empty -->|Yes| Hide["IsImageSet=false, hidden style"]
	Empty -->|No| Keyword[Select icon by keyword]
	Keyword --> Strip["Strip complete: from text"]
	Complete --> Render[Render image + label]
	Hide --> Render
	Strip --> Render
	Render -->|Exception| ErrOut([Write exception detail])
	Render --> Done([Rendered])
```

## Failure and edge-case behavior

- On failure: write the exception message, source and stack trace to the output stream.

## Related documentation
- [Operations and processes](../operations-processes.md)
- [Business rules](../business-rules.md)

> **Note:** Statements marked with `*` were inferred from code structure, naming conventions, or contextual evidence where direct confirmation was not available in source artifacts. Statements marked with `**` could not be confirmed; treat as unknown until verified.

## Sources
- `SAIF.Presentation.Web.Controls.V2/SAIFMessage.vb`
