Skip to content

BindingManager

BindingManager is the page-level orchestrator that drives binding across every iAutoBindingControl on a page in a single call. Its DataBind() walks the entire Page.Controls tree once, resolving the model just once and pushing it into every discoverable auto-binding control, and it doubles as the single page-level validity gate consumers query via IsValid/ErrorMessages. (BR-AJAX-001, BR-AJAX-013)

Purpose

  • Resolves the page's Model property once and pushes it as RootBindingObject into every iAutoBindingControl reachable from Page.Controls, so page code-behind never has to bind controls individually. (BR-AJAX-001, BR-AJAX-002)
  • Aggregates page-level validity by walking the same control tree and returning False on the first invalid control, giving pages a single boolean gate for "can I submit". (BR-AJAX-013)
  • Aggregates deduplicated error text from every control into one combined message, avoiding repeated identical messages when several controls share a validation rule. (BR-AJAX-010)

Context

  • Namespace: SAIF.Presentation.Web.Controls.V2.AJAX
  • Assembly/package: SAIF.Presentation.Web.Controls.AJAX.Infragistics111 (packaged in SAIF.BOF.Presentation.Web.Infragistics111)
  • Base class: System.Web.UI.WebControls.CompositeControl (.NET Framework)

Public members

Member Signature Purpose
RootObjectName Property RootObjectName As String (default "Model") Declared as the name of the page property to bind from, but the private GetRootObject hard-codes "Model" and ignores this setting*
DataBind Overrides Sub DataBind() Resolves the page's Model once, then recursively walks Page.Controls, assigning RootBindingObject on every iAutoBindingControl (or one whose BindingContainer is one) (BR-AJAX-001, BR-AJAX-002)
IsValid ReadOnly Property IsValid As Boolean Walks the control tree and returns False on the first invalid auto-binding control found (BR-AJAX-013)
ErrorMessages ReadOnly Property ErrorMessages As String Walks the control tree, appending each control's messages with <br> separators and skipping duplicates (BR-AJAX-010)

Behavioral notes

  • RootObjectName is publicly settable and defaults to "Model", but the private GetRootObject method hard-codes the literal "Model" rather than reading this property — whether the property is vestigial or the omission is a defect is unknown.**
  • Only leaf controls (controls with no children) are inspected for iAutoBindingControl/BindingContainer membership during both DataBind and the validity walk, so a composite iAutoBindingControl that itself has children is bound through its child's BindingContainer rather than directly.*
  • A control that is neither an iAutoBindingControl nor hosted by one is silently skipped in every walk — no error is raised. (BR-AJAX-002)

Constraints and usage notes

  • The hosting page must expose a property literally named Model; setting RootObjectName to anything else has no effect. (BR-AJAX-001)
  • Because IsValid short-circuits on the first invalid control while ErrorMessages always walks the full tree, calling only IsValid will not populate the complete aggregated error text — both must be read to get validity and full messages.

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