---
title: Render a control in read-only mode
summary: Swap an interactive input control for static, read-only markup while preserving posted state.
status: draft
owner: SAIF Doc Gen
last_reviewed: 2026-08-17
library: SAIF.Presentation.Web.Controls.V2
reference_type: package
operation_id: OP-V2-004
trigger: ASP.NET page lifecycle invokes `Render` on the control.
---

# 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](../business-rules.md#br-v2-021-readonly-persisted-per-control-in-viewstate))
2. If not read-only, delegate to the base control's `Render`. ([BR-V2-022](../business-rules.md#br-v2-022-non-read-only-controls-render-as-their-stock-base-class))
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](../business-rules.md#br-v2-023-read-only-mode-keeps-the-real-input-off-screen))
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](../business-rules.md#br-v2-024-read-only-checkboxes-use-static-images), [BR-V2-025](../business-rules.md#br-v2-025-read-only-radio-buttons-use-static-images), [BR-V2-026](../business-rules.md#br-v2-026-read-only-label-placement-follows-textalign))
   - `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.

```mermaid
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
- [Operations and processes](../operations-processes.md)
- [Business rules](../business-rules.md)

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