Skip to content

Render a control in read-only mode

Swap an interactive input control for static, read-only markup while preserving posted state. ASP.NET page lifecycle invokes Render on the control.

Field Value
Operation ID OP-V2-004
Trigger ASP.NET page lifecycle invokes Render on the control.
Inputs ReadOnly ViewState entry, TextAlign, control style/CSS attributes.
Outputs Either the interactive base control markup, or static read-only markup (image + label).
Primary components SAIFCheckBox.Render (and SAIFCheckBoxList, SAIFRadioButton, SAIFRadioButtonList)
Entry point SAIF.Presentation.Web.Controls.V2/SAIFCheckBox.vb

Steps

  1. Read the ReadOnly property from ViewState (key UniqueID & "ReadOnly"), defaulting to False. (BR-V2-021)
  2. If not read-only, delegate to the base control's Render. (BR-V2-022)
  3. If read-only, render a disabled copy of the real checkbox positioned off-screen (left: -10000px, top: -10000px, TabIndex = -1) so postback view state is preserved. (BR-V2-023)
  4. Emit a <span> reproducing the control's inline styles, then a checked or unchecked static image (/Resources/Images/Cb_checked.bmp or cb_unchecked.bmp) with the label placed left or right according to TextAlign. (BR-V2-024, BR-V2-025, BR-V2-026)
  5. SAIFCheckBoxList, SAIFRadioButton and SAIFRadioButtonList follow the same shape using cb_checked.bmp/cb_unchecked.bmp and rb_checked.gif/rb_unchecked.gif respectively.

Process flow

The following diagram visualizes this operation's control flow.

flowchart TD
    Start([Render]) --> RO{ReadOnly?}
    RO -->|No| Base[MyBase.Render]
    RO -->|Yes| Hidden[Render disabled, off-screen input]
    Hidden --> Img[Render static image + label per TextAlign]
    Base --> EndOk([Rendered])
    Img --> EndOk

Failure and edge-case behavior

  • No exceptional failure handling beyond the branches described in Steps was found in the analysis findings.*

Sources

  • SAIF.Presentation.Web.Controls.V2/SAIFCheckBox.vb