Skip to content

Bind page controls to the model

This operation resolves the hosting page's Model object once and pushes it into every control on the page that participates in automatic binding, so that each control can subsequently bind its own value.

Field Value
Operation ID OP-AJAX-01
Trigger Page code-behind calls BindingManager.DataBind()
Inputs The page's Model property, Page.Controls tree
Outputs Every auto-binding control on the page has RootBindingObject set
Primary components BindingManager.DataBind
Entry point SAIF.Presentation.Web.Controls.AJAX.Infragistics111/BindingManager.vb

Steps

  1. Resolve the root object once via BindingUtility.GetObjectValue(Page, "Model") and cache it. (BR-AJAX-001)
  2. The hosting page must expose a property literally named Model; BindingManager.RootObjectName is publicly settable but the private GetRootObject hard-codes "Model", so the setting is not honored.*
  3. Walk Page.Controls recursively; for any control that has children, recurse, otherwise call BindControl. (BR-AJAX-002)
  4. BindControl assigns RootBindingObject = RootObject when the control is an iAutoBindingControl, or when its BindingContainer is one. (BR-AJAX-002)
  5. If the control is neither, it is silently skipped.
  6. Only leaf controls are inspected, so an iAutoBindingControl that itself has children is bound through its child's BindingContainer rather than directly.*

Process flow

The following diagram visualizes this operation's control flow.

flowchart TD
    Start([BindingManager.DataBind called]) --> Resolve[Resolve Model via reflection]
    Resolve --> Walk[Walk Page.Controls recursively]
    Walk --> Leaf{Leaf control?}
    Leaf -->|No| Walk
    Leaf -->|Yes| Check{Is iAutoBindingControl<br>or BindingContainer is one?}
    Check -->|Yes| Assign[Assign RootBindingObject]
    Check -->|No| Skip([Skip control])
    Assign --> Done([All controls bound])

Failure and edge-case behavior

  • A control that is neither an iAutoBindingControl nor hosted by one is silently skipped — no error is raised.*
  • An iAutoBindingControl with its own children is bound through its child's BindingContainer rather than directly, because only leaf controls are inspected.*

Note: Statements marked with * were inferred from code structure, naming conventions, or contextual evidence where direct confirmation was not available in source artifacts. Statements marked with ** could not be confirmed; treat as unknown until verified.

Sources

  • SAIF.Presentation.Web.Controls.AJAX.Infragistics111/BindingManager.vb
  • SAIF.Presentation.Web.Controls.AJAX.Infragistics111/BindingUtility.vb