Skip to content

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)
  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, BR-V2-039)
  3. Origin: This step delegates to Utilities.mdlUtilities.SetControlManagerEnableable (this library, see Control-manager enableability helpers).

  4. On RenderControl, emit a one-row table; in design mode force the "complete" icon. (BR-V2-040)
  5. 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)
  6. 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, BR-V2-043, BR-V2-044, BR-V2-045, BR-V2-046)
  7. Render image, label and closing tags.
  8. 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.

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.

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