---
title: Harvest posted control values
summary: Walks the page's control tree and collects the current value of every recognized input control into a name/value map for the screen's Retrieve implementation.
status: draft
owner: SAIF Doc Gen
last_reviewed: 2026-08-17
library: SAIF.Presentation.Web.MVC
reference_type: package
operation_id: OP-MVC-09
trigger: Page_Load, via clsControllerBase.CallRetrieve
---

# Harvest posted control values

Gives every derived screen its posted control values without per-control wiring. This operation recognizes both standard ASP.NET controls and vendor/SAIF controls purely by their type name, so the framework takes no compile-time dependency on the vendor assemblies.

| Field | Value |
| --- | --- |
| **Operation ID** | OP-MVC-09 |
| **Trigger** | `Page_Load` → `CallRetrieve` |
| **Inputs** | The page's control tree |
| **Outputs** | Hashtable of control values keyed by control ID, passed to the derived `Retrieve` |
| **Primary components** | `clsControllerBase.CallRetrieve` → `GetInControls` |
| **Entry point** | SAIF.Presentation.Web.MVC/clsControllerBase.vb |

## Steps

1. Walk the page's control tree recursively, descending into any control that `HasControls` ([BR-MVC-020](../business-rules.md#br-mvc-020-posted-control-values-are-harvested-by-recognized-type)).
2. For each control, switch on the upper-cased type name and read its value: `TextBox.Text` (inside a swallowing `Try`), `DropDownList.SelectedValue`, `ListBox.SelectedValue`, `CheckBox.Checked`, `RadioButton.Checked` ([BR-MVC-020](../business-rules.md#br-mvc-020-posted-control-values-are-harvested-by-recognized-type)).
   - On failure (`TextBox.Text` read): the exception is swallowed and processing continues with the next control.
3. For Infragistics editors (`WEBCURRENCYEDIT`, `WEBDATETIMEEDIT`, `WEBMASKEDIT`, `WEBNUMERICEDIT`, `WEBTEXTEDIT`) and `WEBDATECHOOSER`, read the `Text` property reflectively and trim it ([BR-MVC-020](../business-rules.md#br-mvc-020-posted-control-values-are-harvested-by-recognized-type), [BR-MVC-021](../business-rules.md#br-mvc-021-vendorsaif-controls-are-recognized-by-type-name-not-assembly-reference)).
4. For `WEBCOMBO`, read `DisplayValue` reflectively; for `SAIFMENU`, read `ContextValue` ([BR-MVC-021](../business-rules.md#br-mvc-021-vendorsaif-controls-are-recognized-by-type-name-not-assembly-reference)).
   - If a control's type name matches none of the recognized cases: the control is silently skipped and contributes no entry to the value map.
5. Store each value in the hashtable keyed by control ID, then call the derived `Retrieve(controlValues, Context.GetContext("targetView"))`.

## Process flow

The following diagram visualizes this operation's control flow.

```mermaid
flowchart TD
	Start([CallRetrieve]) --> S1[Walk control tree recursively]
	S1 --> S2{Recognized standard control type?}
	S2 -->|Yes| S3[Read value via type-specific property]
	S2 -->|No| S4{Recognized vendor/SAIF control?}
	S4 -->|Yes| S5[Read value reflectively]
	S4 -->|No| S6[Skip control]
	S3 --> S7[Store in hashtable keyed by control ID]
	S5 --> S7
	S6 --> S7
	S7 --> EndOk([Call derived Retrieve with control values])
```

## Failure and edge-case behavior
- `TextBox.Text` reads are wrapped in a swallowing `Try`, so a failure reading one text box does not abort the harvest of the remaining controls.
- Unrecognized control types (custom or third-party controls not in the switch list) are silently ignored rather than raising an error.

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

## Sources
- SAIF.Presentation.Web.MVC/clsControllerBase.vb
