---
title: SAIF.Presentation.Web.MVC operations and processes
summary: Business and technical operations supported by 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 operations and processes

This page is the operation catalog and cross-operation hub for this library. Each operation's detailed, step-by-step logic lives in its own page under `operations/`.

## Operation catalog
| Operation | Intent | Trigger | Inputs | Outputs | Rules | Tables | SQL |
| --- | --- | --- | --- | --- | --- | --- | --- |
| [Page/control lifecycle initialization](operations/page-control-lifecycle-initialization.md) | Orchestrate the WebForms page/control request lifecycle: timeout check, authentication, menu authorization, model pre-init, query-string handling | `ViewPageBase.Page_Init` / `ViewControlBase.Page_Init` | Current `HttpContext` (session, query string, request path) | Populated `Model`, `Session("navdata")`, possible redirect/response termination | [BR-MVC-001](business-rules.md#br-mvc-001-session-timeout-redirect), [BR-MVC-002](business-rules.md#br-mvc-002-menu-based-page-authorization), [BR-MVC-003](business-rules.md#br-mvc-003-authenticated-principal-required) | — | [SQL-MVC-003](sql/SQL-MVC-003-retrieve-single-context-value.md) |
| [Cross-application context hand-off](operations/cross-application-context-hand-off.md) | Merge context values left by a prior application into the current model when arriving via a cross-application referrer | `clsControllerBase.CheckContext` (referrer present, step 9 of initialization) | Referring URL path, current session ID | Merged context values, possible navigation | [BR-MVC-005](business-rules.md#br-mvc-005-cross-application-context-transfer-only-across-distinct-applications) | [Context](database-tables.md#context) | [SQL-MVC-002](sql/SQL-MVC-002-retrieve-cross-application-context.md), [SQL-MVC-004](sql/SQL-MVC-004-delete-context-rows.md) |
| [Cross-application navigation](operations/cross-application-navigation.md) | Persist context and redirect/pop-up to a target application or view, optionally with a new model instance | Explicit controller call (`Navigate`/`Navigate2`) from concrete application code | Target app/view, popup flags | HTTP redirect or `window.open` script, persisted context row(s) | [BR-MVC-004](business-rules.md#br-mvc-004-multi-model-requires-configuration), [BR-MVC-005](business-rules.md#br-mvc-005-cross-application-context-transfer-only-across-distinct-applications) | [Context](database-tables.md#context) | [SQL-MVC-001](sql/SQL-MVC-001-insert-context-value.md), [SQL-MVC-004](sql/SQL-MVC-004-delete-context-rows.md) |
| [Model write pipeline](operations/model-write-pipeline.md) | Validate model state before persisting it | Explicit controller/page call (typically a save postback) | Model's in-memory state populated by the concrete `Retrieve` | Boolean success | [BR-MVC-006](business-rules.md#br-mvc-006-write-requires-prior-validation) | — | — |
| [Error handling](operations/error-handling.md) | Centralize unhandled-exception routing, logging, and redirect to an error page | `ViewPageBase.Page_Error` | The unhandled exception | User-facing message and/or redirect | — | — | — |

<!-- Note: the on-page anchor sql/SQL-MVC-* links above are relative to this page's own directory (operations-processes.md is at the library root, so links resolve as sql/...). -->

## Process flow diagram
The following diagram visualizes the primary operational flow across operations.

```mermaid
flowchart TD
	Start([HTTP request arrives]) --> Init[Page/control lifecycle initialization]
	Init --> SecCheck{Authenticated?}
	SecCheck -->|No, clsEnvironment.InternalAddress true| Challenge([401 NTLM/Basic challenge])
	SecCheck -->|No, clsEnvironment.InternalAddress false| Deny([Throw Not Authorized])
	SecCheck -->|Yes| MenuCheck{Menu authorized?}
	MenuCheck -->|No| LoginRedirect([Redirect to OnlineLogin/LoginScreen.aspx])
	MenuCheck -->|Yes| Referrer{Referrer present?}
	Referrer -->|Yes, different app| ContextHandoff[Cross-application context hand-off]
	Referrer -->|No / same app| Retrieve[CallRetrieve: concrete Retrieve hook]
	ContextHandoff --> Retrieve
	Retrieve --> UserAction{User navigates or saves?}
	UserAction -->|Navigate| Navigation[Cross-application navigation]
	UserAction -->|Save| Write[Model write pipeline]
	UserAction -->|Unhandled error| ErrorHandling[Error handling]
	Navigation --> EndNav([Redirect / popup])
	Write --> EndWrite([Persisted or rejected])
	ErrorHandling --> EndErr([Error page redirect])
```

## Database interactions

The following table summarizes which operations read from or write to the database. Per-step SQL and table citations live in each operation's detail page under `operations/`.

| Operation | SQL | Tables | Type |
| --- | --- | --- | --- |
| [Page/control lifecycle initialization](operations/page-control-lifecycle-initialization.md) | [SQL-MVC-003](sql/SQL-MVC-003-retrieve-single-context-value.md) | [Context](database-tables.md#context) | Read |
| [Cross-application context hand-off](operations/cross-application-context-hand-off.md) | [SQL-MVC-002](sql/SQL-MVC-002-retrieve-cross-application-context.md), [SQL-MVC-004](sql/SQL-MVC-004-delete-context-rows.md) | [Context](database-tables.md#context) | Read, Delete |
| [Cross-application navigation](operations/cross-application-navigation.md) | [SQL-MVC-004](sql/SQL-MVC-004-delete-context-rows.md), [SQL-MVC-001](sql/SQL-MVC-001-insert-context-value.md) | [Context](database-tables.md#context) | Delete, Write |

## Failure and edge-case behavior
- Session-timeout redirects swallow the `ThreadAbortException` raised by `Response.Redirect`/`Response.End` via `Thread.ResetAbort()`, so the abort does not propagate as an unhandled error.
- `clsContextRepository.Delete`/`Retrieve`/`Save` wrap all ADO.NET failures in an `ApplicationException` with a fixed message (e.g., `"Context Repository Delete Failed."`), losing the original exception's type but preserving it as `InnerException`.
- No rowcount/contention validation exists around the delete-then-insert (`SaveContext`) or read-then-delete (`RetrieveContext`) flows against the `Context` table — a concurrent request for the same session could race with these operations.
- `Navigate2` requires `SupportsMultiModel = True`; calling it otherwise throws `ApplicationException("Navigate2 only supported with Multiple Model configuration.")` ([BR-MVC-004](business-rules.md#br-mvc-004-multi-model-requires-configuration)).

## Related documentation
- [Index](index.md)
- [Overview](overview.md)
- [Architecture](architecture.md)
- [Dependencies](dependencies.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\clsControllerBase.vb
- SAIF.Presentation.Web.MVC\clsContext.vb
- SAIF.Presentation.Web.MVC\clsModelBase.vb
- SAIF.Presentation.Web.MVC\ViewPageBase.aspx.vb
- SAIF.Presentation.Web.MVC\NavigationContext.vb
