Skip to content

AutoBindControlAncestor

AutoBindControlAncestor implements the shared reflection-based binding and validation plumbing for every auto-binding editor control in this library (AutoBindTextbox, AutoBindWebDateTimeEdit, AutoBindWebMaskEdit). It resolves a bound business-object property via a dotted path (BindSource), synchronizes it with the control's Value, and surfaces the bound object's own IDataErrorInfo validation errors on both the control and a shared page error label.

Purpose

  • Implements iAutoBindingControl's binding contract: resolves BoundObject from RootBindingObject/BindSource via BindingUtility.GetObject, and reads/writes BindProperty to/from Value via BindingUtility.BindValue (see Auto-bind an individual control to its bound object).
  • Enforces BR-AJAX-001 by surfacing the bound object's IDataErrorInfo error text on the control's background color and on a shared page label (LblErrorMsg).
  • Wires an Infragistics WebAsyncRefreshPanel (WARP) and a HoverPanel so inline validation errors update via partial-page (AJAX) postback.

Context

  • Namespace: SAIF.Presentation.Web.Controls.V2.AJAX
  • Assembly/package: SAIF.Presentation.Web.Controls.AJAX.Infragistics103

Public members

Member Signature Purpose
HeaderText Property HeaderText() As String Header caption text made available to concrete subclasses for hover/label rendering
HelpText Property HelpText() As String Help text made available to concrete subclasses for hover/label rendering
BindSource Property BindSource() As String Dotted property path identifying the bound object relative to RootBindingObject
BindProperty Property BindProperty() As String Name of the property on BoundObject this control's Value reads from and writes to
RootBindingObject Property RootBindingObject() As Object The page model object from which BoundObject is resolved
AutoPostback Property AutoPostback() As Boolean Controls whether the underlying editor posts back immediately on value change
AutoBind Property AutoBind() As Boolean Indicates whether the control participates in automatic page-wide binding
AutoValidate Property AutoValidate() As Boolean Controls whether Validate() runs automatically after BindToObject()
AutoValidateOnDataBind Property AutoValidateOnDataBind() As Boolean Controls whether Validate() runs automatically after DataBind()
IsBound ReadOnly Property IsBound() As Boolean Guard that determines whether the control has a live target to participate in binding/validation, gating DataBind()/Validate() from acting on an unresolved object
IsValid ReadOnly Property IsValid() As Boolean Validity status consumed by Validate()/StyleControl to color the control and by BindingManager to aggregate page-wide validity; reflects whether the bound object currently reports any IDataErrorInfo errors for BindProperty
ErrorMessages ReadOnly Property ErrorMessages() As String() The bound object's current validation errors for BindProperty, split from IDataErrorInfo.Item
Value MustOverride Property Value() As Object The control's current UI value; concrete subclasses supply the storage and type conversion
DataBind Overrides Sub DataBind() Runs the full bind cycle: reads the bound property into Value, then validates if AutoValidateOnDataBind
Validate Overridable Function Validate() As Boolean Collects unique error messages, writes them to the page's LblErrorMsg control, and calls StyleControl
StyleControl MustOverride Sub StyleControl(inValid As Boolean) Applies visual styling (background color) reflecting validity; implemented per concrete control

Inherited public members

Members in this section are inherited from SAIFAJAXControlAncestor and, transitively, System.Web.UI.WebControls.CompositeControl in the .NET Framework Base Class Library. They are available on this type through inheritance.

Member Signature Purpose Origin
RootObject Protected ReadOnly Property RootObject() As Object Lazily resolves and caches the page's "Model" object for use by this control SAIFAJAXControlAncestor
IsFirefox Protected ReadOnly Property IsFirefox() As Boolean Indicates whether the requesting browser identifies itself as Firefox SAIFAJAXControlAncestor
ID Property ID As String The programmatic identifier assigned to this control instance System.Web.dll — System.Web.UI.Control
Visible Property Visible As Boolean Controls whether this control renders on the page System.Web.dll — System.Web.UI.Control
CssClass Property CssClass As String The CSS class rendered on the composite control's root container element System.Web.dll — System.Web.UI.WebControls.WebControl
CreateChildControls Overridable Sub CreateChildControls() Builds this composite control's child control tree; overridden by this class's concrete rendering logic System.Web.dll — System.Web.UI.WebControls.CompositeControl
RenderContents Overridable Sub RenderContents(writer As HtmlTextWriter) Renders this composite control's markup to the response stream System.Web.dll — System.Web.UI.WebControls.CompositeControl

Behavioral notes

  • PageErrorLabel searches Page.Controls recursively (case-insensitive UniqueID match) for a control named LblErrorMsg; if none exists, SetObjectValue silently swallows the resulting NotSupportedException and no error text is displayed*.
  • Several previously-implemented members (ControlID, direct BoundObject/BoundProperty setters, a Bind() method) are commented out and not part of the active implementation.

Constraints and usage notes

  • MustInherit: concrete controls must implement Value and StyleControl.
  • DataBind() no-ops entirely if RootBindingObject is Nothing.

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.Infragistics103\AutoBindControlAncestor.vb