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¶
- Read the
ReadOnlyproperty fromViewState(keyUniqueID & "ReadOnly"), defaulting toFalse. (BR-V2-021) - If not read-only, delegate to the base control's
Render. (BR-V2-022) - 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) - Emit a
<span>reproducing the control's inline styles, then a checked or unchecked static image (/Resources/Images/Cb_checked.bmporcb_unchecked.bmp) with the label placed left or right according toTextAlign. (BR-V2-024, BR-V2-025, BR-V2-026) SAIFCheckBoxList,SAIFRadioButtonandSAIFRadioButtonListfollow the same shape usingcb_checked.bmp/cb_unchecked.bmpandrb_checked.gif/rb_unchecked.gifrespectively.
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.*
Related documentation¶
Sources¶
SAIF.Presentation.Web.Controls.V2/SAIFCheckBox.vb