---
title: WebContextControllerBase
summary: API reference for WebContextControllerBase.
status: draft
owner: SAIF Documentation
last_reviewed: 2026-09-17
library: SAIF.Framework.Web.Mvc
reference_type: package
---

# WebContextControllerBase

Base controller that resolves and persists the per-request web context, and drives cross-application/same-application navigation redirects; every controller that participates in web-context handoff derives from this class (directly or via `MenuControllerBase`).

## Purpose
- Base controller that resolves and persists the per-request web context, and drives cross-application/same-application navigation redirects; every controller that participates in web-context handoff derives from this class (directly or via `MenuControllerBase`).

## Context
- Namespace: `SAIF.Web.Mvc.Controllers`
- Assembly/package: `SAIF.Framework.Web.Mvc (source-shipping NuGet package)`
- Kind: abstract class

## Public members
| Member | Signature | Purpose |
| --- | --- | --- |
| WebContext | `protected IWebContext WebContext { get; }` | The resolved context for the current request, populated during `OnActionExecuting`. |
| Navigate(string url) | `public virtual ActionResult Navigate(string url)` | Convenience overload that wraps a URL into a `NavigateViewModel` and calls the primary `Navigate` overload. |
| Navigate(NavigateViewModel model) | `[HttpPost] public virtual ActionResult Navigate(NavigateViewModel model)` | Redirects to `model.Url`, handing context off across applications via the remote service or via TempData within the same application; see the "Navigate between applications and views" operation. |
| SessionPing() | `public ActionResult SessionPing()` | Lightweight action used to keep the ASP.NET session alive from client-side polling.* |
| WebContextAsString(string delimiter = null) | `public string WebContextAsString(string delimiter = null)` | Formats the current context id/value as a delimited diagnostic string, consumed by `HandleExceptionAttribute` when building log state. |
| OnActionExecuting(ActionExecutingContext) | `protected override void OnActionExecuting(ActionExecutingContext filterContext)` | Resolves the web context before the action runs; see the "Resolve web context for an incoming request" operation. |
| OnActionExecuted(ActionExecutedContext) | `protected override void OnActionExecuted(ActionExecutedContext filterContext)` | Copies the resolved context onto a `WebContextViewModelBase` model; see the "Project web context onto the view model" operation. |

> **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
- `src/Web.Mvc/Controllers/WebContextControllerBase.cs`
