Skip to content

AppViewPageBase

AppViewPageBase is the WebForms page base class that every SAIF application screen in this package inherits from. It extends SAIF.Presentation.Web.mvc.ViewPageBase (from SAIF.Presentation.Web.MVC) with Infragistics-11.1-aware behavior: session keep-alive script registration, control back-color normalization on every load, e-mail-popup launching via mailto: links, and column/sort/size grid-preference persistence for UltraWebGrid and WebDataGrid. It is the intra-repository merge point between the MVC controller/model plumbing and the Infragistics grid ecosystem.

Purpose

  • Enable session keep-alive by default on page Init so authenticated sessions stay alive while a user is actively viewing a page. (BR-CORE-001)
  • Suppress the session-ping script for externally classified clients so those sessions are allowed to time out normally. (BR-CORE-002)
  • Re-normalize control back-colors on every page load unless the page opts out, keeping field colouring consistent across postbacks. (BR-CORE-004)
  • Register client script that opens the user's default e-mail client via a sanitized mailto: URL.
  • Persist, apply, and clear per-user grid preferences (column order, sort, sizing) for UltraWebGrid and WebDataGrid instances hosted on the page.

Context

  • Namespace: SAIF.Presentation.Web.Core
  • Assembly/package: SAIF.Presentation.Web.Core.Infragistics111 (merged into SAIF.Presentation.Web.Infragistics111.dll via SAIF.BOF.Presentation.Web.Infragistics111.nuspec)

Public members

Member Signature Purpose
EnableSessionPing Public Property EnableSessionPing As Boolean Controls whether CallSessionPing will register the keep-alive script; defaults to True on every page's Page_Init.
CallResetBackcolor Public Property CallResetBackcolor As Boolean Controls whether Page_Load re-normalizes control back-colors for this page instance; defaults to True.
CallSessionPing() Protected Sub CallSessionPing() Registers PingSession.js and calls InitializeSessionPing() only for internal clients (IsClientExternal = False), and only once per page (guards against duplicate registration).
OpenEmailPopup(recipient, cc, subject, body) Public Sub OpenEmailPopup(recipient As String, cc As String, subject As String, body As String) Registers a popup-style window.open("mailto:...") client script with sanitized recipient/subject text.
OpenEmailScriptManager(recipient, cc, subject, body) Public Sub OpenEmailScriptManager(recipient As String, cc As String, subject As String, body As String) Registers the same mailto: script via ScriptManager.RegisterClientScriptBlock so it survives an UpdatePanel partial postback.
ApplySavedPreferences(grid) Public Sub ApplySavedPreferences(grid As Object) Applies previously persisted column order, sort, and sizing preferences to the supplied grid instance.
SavePreferences(grid) Public Sub SavePreferences(grid As Object) Persists the current column order, sort, and sizing state of the supplied grid instance for the current user.
ClearPreferences(grid) Public Sub ClearPreferences(grid As Object) Deletes any previously saved preference state for the supplied grid instance.
GRAY Public Const GRAY As String = "#F2F2F2" Standard background color constant used for disabled/read-only field styling.
TABCOLOR Public Const TABCOLOR As String = "#D3D3D3" Standard tab background color constant used by consuming page markup.
MENUCONTEXTTEXTBOX Public Const MENUCONTEXTTEXTBOX As Integer = 2 Index/identifier constant used to locate the menu context text box among page controls.
COLUMN_SORT Public Const COLUMN_SORT As String = "ColSort" Key/suffix constant used when persisting grid column sort preferences.

Behavioral notes

  • Page_Init sets EnableSessionPing = True unconditionally; a consuming page must explicitly set it to False after base initialization to opt out.
  • Session-ping registration checks for an already-registered SessionPing script block before adding a new one, so calling CallSessionPing more than once per page has no duplicate effect.
  • Grid preference persistence delegates to m_controller.Model.Preferences (SAIF.Framework.Preferences), an external framework dependency not present in this repository.**

Constraints and usage notes

  • Consuming pages must inherit AppViewPageBase rather than ViewPageBase directly to receive session-ping, back-color reset, and grid-preference behavior.
  • The e-mail popup methods depend on Utilities.clsStringUtilities.CleanForEmail for sanitization; body text sanitization is present in source but currently commented out, so body text is not sanitized before being placed in the mailto: URL.*

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.Core.Infragistics111/AppViewPageBase.aspx.vb