ViewControlBase¶
ViewControlBase is the UserControl counterpart of ViewPageBase, used when a SAIF screen is composed as an embeddable ASCX control rather than a full page. It runs its own controller (from a clsFactoryBase implementation supplied by the derived control) through the ASP.NET control lifecycle — Page_Init constructs and initializes the controller, Page_Error delegates to clsControllerBase.HandleErrors(), and Page_Unload calls UnInitialize — mirroring ViewPageBase's pipeline but without view-identity/multi-model support or an overridden PageStatePersister, since those are page-level, not control-level, concerns.
Purpose¶
- Gives an ASP.NET user control the same controller-driven initialize/retrieve/uninitialize lifecycle that
ViewPageBasegives a full page. - Exposes
ApplicationNameas a pass-through to the underlying model's context, so markup and code-behind in the control can read/set the owning application without reaching through the controller. - Provides a
PageModeproperty (via its own nestedPageModeEnum) so a control can track its own view/update/delete/print/PDF state independently of any hosting page.
Context¶
- Namespace:
SAIF.Presentation.Web.MVC* - Assembly/package:
SAIF.Presentation.Web.MVC
Public members¶
| Member | Signature | Purpose |
|---|---|---|
PageMode |
Public Property PageMode() As PageModeEnum |
The current view/update/delete/print/PDF mode for this control instance, held in the control's own ViewState |
ApplicationName |
Public Property ApplicationName() As String |
Pass-through accessor to m_controller.Model.Context.ApplicationName — reads/sets the application name on the underlying model context |
PageModeEnum |
Public nested enum | See ViewControlBase.PageModeEnum |
Behavioral notes¶
- Unlike
ViewPageBase,ViewControlBase'sNavigationManageris constructed but never wired up in the observed code — theNavManager = New NavigationManager(Me)call inPage_LoadandNavManager.GenerateScripts()inPage_PreRenderare both commented out, so focus restoration is effectively inactive for user controls despite the supporting class being present. Page_Errorcalls the parameterlessclsControllerBase.HandleErrors()overload (which reads the error fromHttpContext.Current.Error), not the exception-parameter overload thatViewPageBase.ProcessErroruses — so a control does not get the richer SAIF-exception classification (timeout/unavailable messaging) thatViewPageBase.ProcessErrorperforms.
Constraints and usage notes¶
ApplicationName's getter/setter both assumem_controllerandm_controller.Modelare already initialized (set duringPage_Init); accessing it beforePage_Inithas run would fail.*
Note: Statements marked with
*were inferred from code structure, naming conventions, or contextual evidence where direct confirmation was not available in source artifacts.
Sources¶
- SAIF.Presentation.Web.MVC/ViewControlBase.ascx.vb