Page-wide auto-bind and validate¶
BindingManager is the page-level orchestrator for every auto-binding control on an ASPX page. The hosting page invokes BindingManager.DataBind() (typically in Page_Load/Page_PreRender) once the page's model is available; the method recursively walks Page.Controls, assigns the resolved model (RootObject) to each discovered iAutoBindingControl, and later exposes aggregated IsValid/ErrorMessages across the whole page.
| Field | Value |
|---|---|
| Operation ID | OP-AJAX-001 |
| Trigger | Hosting page calls BindingManager.DataBind(), typically from Page_Load/Page_PreRender |
| Inputs | Page.Controls tree; a RootObject resolved from the page's "Model" property |
| Outputs | Every discovered auto-binding control is data-bound to the model; IsValid/ErrorMessages reflect the aggregate binding state |
| Primary components | BindingManager.DataBind, BindingManager.GetRootObject, BindingManager.IsValid, BindingManager.ErrorMessages |
| Entry point | SAIF.Presentation.Web.Controls.AJAX.Infragistics103\BindingManager.vb |
Steps¶
RootObjectgetter resolves the bound model viaBindingUtility.GetObjectValue(Page, "Model")if not already cached.DataBind()recursively walksPage.Controls(privateDataBind(inControls)overload).- For each leaf control,
BindControlchecks whether the control (or itsBindingContainer) implementsiAutoBindingControl; if so, itsRootBindingObjectis set toRootObject. No SQL/table access occurs at this step. - Each bound
iAutoBindingControl's ownDataBind()then executes as part of the standard ASP.NET control lifecycle when the framework callsDataBind()on the control tree. - See Auto-bind an individual control to its bound object for the per-control logic.
IsValid(read-only) recursively callsCheckValidControlsoverPage.Controls, returningFalseon the first control whoseiAutoBindingControl.IsValidisFalse.ErrorMessagesrecursively collects and de-duplicates error strings from everyiAutoBindingControl.ErrorMessagesinto an HTML<br>-joined string (GetErrorMessages,AppendUniqueMessages).
Process flow¶
The following diagram visualizes this operation's control flow.
flowchart TD
Start([Page invokes BindingManager.DataBind]) --> Walk[Recursively walk Page.Controls]
Walk --> Check{Control implements iAutoBindingControl?}
Check -->|Yes| Assign[Set RootBindingObject on control]
Check -->|No| Next[Continue to next control]
Assign --> CtrlDataBind[ASP.NET lifecycle invokes control's own DataBind]
CtrlDataBind --> Aggregate[IsValid/ErrorMessages aggregate across all controls]
Failure and edge-case behavior¶
- No page model (
"Model"property returnsNothing):RootObjectresolves toNothing; downstream controls receive aNothingRootBindingObjectand their ownDataBind()will no-op (see the per-control operation).
Related documentation¶
Sources¶
SAIF.Presentation.Web.Controls.AJAX.Infragistics103\BindingManager.vbSAIF.Presentation.Web.Controls.AJAX.Infragistics103\BindingUtility.vbSAIF.Presentation.Web.Controls.AJAX.Infragistics103\iAutoBindingControl.vb