Skip to content

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

  1. RootObject getter resolves the bound model via BindingUtility.GetObjectValue(Page, "Model") if not already cached.
  2. DataBind() recursively walks Page.Controls (private DataBind(inControls) overload).
  3. For each leaf control, BindControl checks whether the control (or its BindingContainer) implements iAutoBindingControl; if so, its RootBindingObject is set to RootObject. No SQL/table access occurs at this step.
  4. Each bound iAutoBindingControl's own DataBind() then executes as part of the standard ASP.NET control lifecycle when the framework calls DataBind() on the control tree.
  5. See Auto-bind an individual control to its bound object for the per-control logic.
  6. IsValid (read-only) recursively calls CheckValidControls over Page.Controls, returning False on the first control whose iAutoBindingControl.IsValid is False.
  7. ErrorMessages recursively collects and de-duplicates error strings from every iAutoBindingControl.ErrorMessages into 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 returns Nothing): RootObject resolves to Nothing; downstream controls receive a Nothing RootBindingObject and their own DataBind() will no-op (see the per-control operation).

Sources

  • SAIF.Presentation.Web.Controls.AJAX.Infragistics103\BindingManager.vb
  • SAIF.Presentation.Web.Controls.AJAX.Infragistics103\BindingUtility.vb
  • SAIF.Presentation.Web.Controls.AJAX.Infragistics103\iAutoBindingControl.vb