---
title: SAIF.Presentation.Web.MVC overview
summary: High-level purpose, scope, and responsibilities for this library.
status: draft
owner: SAIF Documentation Team
last_reviewed: 2026-08-17
library: SAIF.Presentation.Web.MVC
reference_type: package
---

# SAIF.Presentation.Web.MVC overview

> **Documentation context:** Referenced via NuGet package manifest
>
> A separate documentation set may exist for this library if it is also referenced directly by a frontend project; none was identified in this run.

`SAIF.Presentation.Web.MVC` supplies the shared base-class framework for a "poor-man's MVC" pattern layered on classic ASP.NET WebForms, used across SAIF's legacy front-end applications. It retrofits Model/View/Controller/Factory roles onto WebForms `Page`/`UserControl` classes and adds cross-application session/context hand-off, menu-driven authorization, and centralized error handling — it does not implement ASP.NET MVC routing or `Controller`/`ActionResult` types.

## Purpose
- Provides abstract base classes (`clsControllerBase`, `clsModelBase`, `clsFactoryBase`) that consuming SAIF web applications inherit from to get a consistent page lifecycle, security enforcement, and error-handling pipeline without re-implementing them per application.
- Persists cross-application "context" hand-off values (claim ID, policy number, SAIF claim number, provider location sequence number) so a user's in-flight state survives navigation between separate SAIF web applications, backed directly by a SQL Server `Context` table.
- Intended for consumption by downstream WebForms applications in the SAIF suite that need page-level menu authorization and cross-application state transfer (e.g., online/agent-facing policy and claim applications built on this shared MVC-style base); a repository-wide inventory of every actual consumer was not performed as part of this analysis.

## Responsibilities
- Orchestrate the WebForms page/control request lifecycle (`clsControllerBase.Initialize`/`CallRetrieve`/`UnInitialize`) on behalf of concrete controllers supplied by each consuming application.
- Enforce two authorization gates on every request: authenticated-principal presence (`SecurityCheck`) and menu-driven page authorization (`RedirectUnauthorizedUsers` via `NavigationContext`).
- Persist and retrieve cross-application context hand-off values in the `Context` table (SQL Server, `NETFRAMEWORK` catalog) via `clsContext`'s private `clsContextRepository`.
- Define the abstract `clsModelBase`/`clsFactoryBase` contract implemented by consuming applications to supply concrete models, controllers, and validation/write behavior.
- Centralize unhandled-exception routing (`ViewPageBase.ProcessError`/`clsControllerBase.HandleErrors`), including SAIF-exception-type dispatch, logging, and redirect to a configurable error page.
- Resolve environment- and deployment-specific settings (SQL Server/Oracle connection keys, trace toggles, error-page overrides, ViewState-in-session behavior) through the Environment API and `Web.config` `<appSettings>`.

## Key components
- `clsContext` / `clsOnlineContext`: cross-request/cross-application state bag; persists context values to the SQL Server `Context` table via a private, direct-ADO.NET repository.
- `clsControllerBase`: abstract controller — page-lifecycle orchestration, security checks, cross-application navigation (`Navigate`/`Navigate2`), and error handling.
- `clsFactoryBase`: abstract factory contract (`GetController`, `GetModel`) letting each consuming application supply its own concrete controller/model pair.
- `clsModelBase`: abstract model — holds `clsContext`/`clsPreferences`, defines the `ValidateData`/`WriteData` contract behind the `Write()` template method, and exposes input-validation helpers.
- `NavigationContext`: wraps `SAIF.Business.Menu` collections (sourced via an Oracle data layer) to answer "is this page authorized for this user" queries used by `RedirectUnauthorizedUsers`.
- `ViewPageBase` / `ViewControlBase`: base WebForms `Page`/`UserControl` code-behind classes that own the ASP.NET page lifecycle events and delegate non-rendering behavior to a `clsControllerBase` instance.

## Related documentation
- [Index](index.md)
- [Architecture](architecture.md)
- [Dependencies](dependencies.md)
- [Operations and processes](operations-processes.md)
- [Business rules](business-rules.md)
- [Security and authorization](security-authorization.md)
- [Configuration](configuration.md)
- [Database tables](database-tables.md)
- [SQL catalog](sql/index.md)
- [API reference](api/index.md)

## Sources
- SAIF.Presentation.Web.MVC\clsContext.vb
- SAIF.Presentation.Web.MVC\clsOnlineContext.vb
- SAIF.Presentation.Web.MVC\clsControllerBase.vb
- SAIF.Presentation.Web.MVC\clsFactoryBase.vb
- SAIF.Presentation.Web.MVC\clsModelBase.vb
- SAIF.Presentation.Web.MVC\NavigationContext.vb
- SAIF.Presentation.Web.MVC\ViewControlBase.ascx.vb
- SAIF.Presentation.Web.MVC\ViewPageBase.aspx.vb
- SAIF.BOF.Presentation.Web.Infragistics103.nuspec
