Skip to content

AppViewPageBase

AppViewPageBase is the shared, MustInherit page base class for consuming SAIF applications, extending SAIF.Presentation.Web.mvc.ViewPageBase with session keep-alive, per-user grid layout preference persistence (UltraWebGrid and WebDataGrid), Infragistics editor focus support, context-sensitive hover-help, and grid-row business-rule error highlighting. Application pages derive from this class instead of directly from the framework's ViewPageBase.

Purpose

  • Manage a periodic session-ping keep-alive script for internal (non-external) client sessions, gated by BR-AVPB-001.
  • Persist, apply, and clear per-user grid column order/width/sort/size preferences via SAIF.Framework.Preferences, for both UltraWebGrid and WebDataGrid controls.
  • Render BOF business-rule validation failures onto data-bound grid cells, enforcing BR-AVPB-002.
  • Provide hover-help content properties that require HelpFolderName to be configured first, enforcing BR-AVPB-003.

Context

  • Namespace: SAIF.Presentation.Web.Core
  • Assembly/package: SAIF.Presentation.Web.Core.Infragistics103 (merged into SAIF.BOF.Presentation.Web.Infragistics103 NuGet package)

Public members

Member Signature Purpose
GRAY Public Const GRAY As String = "#F2F2F2" Standard background color constant available to descendant pages for consistent grid/cell shading.
TABCOLOR Public Const TABCOLOR As String = "#D3D3D3" Standard tab-color constant available to descendant pages for consistent tab-control styling.
MENUCONTEXTTEXTBOX Public Const MENUCONTEXTTEXTBOX As Integer = 2 Conventional numeric identifier used by descendant pages when locating the menu-context textbox control on the page.
COLUMN_SORT Public Const COLUMN_SORT As String = "ColSort" Preference-key suffix used to store/retrieve a grid's saved sort state; shared across the UltraWebGrid/WebDataGrid preference methods.
ControlManager Public ControlManager As Utilities.clsControlManager Field giving page code direct access to the shared control-manipulation utility class.
ErrorColor Public ErrorColor As Drawing.Color = Drawing.Color.Red Default color used when highlighting grid cells bound to properties with broken BOF business rules; consumed by SetErrorColorInGrid, per BR-AVPB-002.
EnableSessionPing Public Property EnableSessionPing() As Boolean Controls whether the session keep-alive script is registered for this page; defaults to True in Page_Init.
CallResetBackcolor Public Property CallResetBackcolor() As Boolean Controls whether clsControlManager.ResetBackColor runs on Page_Load to normalize control CSS classes across the page.
HelpBody Public ReadOnly Property HelpBody() As String Returns the resolved hover-help body content path, derived from HelpFolderName; throws if HelpFolderName is unset.
HelpBookmark Public ReadOnly Property HelpBookmark() As String Returns the resolved hover-help bookmark anchor, derived from HelpFolderName; throws if HelpFolderName is unset.
HelpFolderName Public Property HelpFolderName() As String Gets or sets the folder name under which hover-help content is stored; must be set (typically in an ancestor Configure override) before any Help* property is read.
HelpHeader Public ReadOnly Property HelpHeader() As String Returns the resolved hover-help header content path, derived from HelpFolderName; throws if HelpFolderName is unset.
HelpTOC Public ReadOnly Property HelpTOC() As String Returns the resolved hover-help table-of-contents path, derived from HelpFolderName; throws if HelpFolderName is unset.
CallSessionPing Public Sub CallSessionPing() Registers the session-ping keep-alive script when EnableSessionPing is True and the current client is not external, per BR-AVPB-001.
Configure Public MustOverride Sub Configure(ByVal inSAIFMenu As SAIFMenu, ByVal inSAIFTopMenu As SAIFMenuTop) Abstract extension point that descendant pages must implement to perform page-specific setup (e.g., setting HelpFolderName), receiving the page's bound menu and top-menu controls.
OpenEmailPopup Public Sub OpenEmailPopup(ByVal recip As String, ByVal subject As String, ByVal body As String) Opens a client-side popup window (via mailto:) for composing an outbound email from the page, after cleaning the recipient/subject for safe inclusion in the script.
OpenEmailScriptManager Public Sub OpenEmailScriptManager(ByVal recip As String, ByVal subject As String, ByVal body As String) Registers the client script needed to open the email popup via ScriptManager.RegisterClientScriptBlock, for pages using an UpdatePanel/ScriptManager.
OpenEmailScriptManager (Cc overload) Public Sub OpenEmailScriptManager(ByVal recip As String, ByVal cc As String, ByVal subject As String, ByVal body As String) Overload that additionally supports a Cc recipient, registering the equivalent ScriptManager-compatible client script.
GetSortStringFromGrid Public Overridable Function GetSortStringFromGrid(ByVal inGrid As Infragistics.WebUI.UltraWebGrid.UltraWebGrid) As String Derives a comma/,-delimited "column direction" sort-order string from the grid's current live sort state (its first band's SortedColumns), for use in a data query.
ConfigureHoverHelpItem (HoverHelp overload) Public Sub ConfigureHoverHelpItem(ByVal inHoverHelp As HoverHelp, ByVal inHelpCollection As clsHelpTextCollection, ByVal inReferenceKey As String, Optional ByVal inWidth As Integer = 200, Optional ByVal inPopupPosition As HoverMenuPopupPosition = HoverMenuPopupPosition.Top) Wires up a legacy HoverHelp UI element using content resolved from inHelpCollection/inReferenceKey.
ConfigureHoverHelpItem (SAIFHoverHelp/collection overload) Public Sub ConfigureHoverHelpItem(ByVal inHoverHelp As SAIFHoverHelp, ByVal inHelpCollection As clsHelpTextCollection, ByVal inReferenceKey As String, Optional ByVal inWidth As Integer = 200, Optional ByVal inPopupPosition As HoverHelpPopupPosition = HoverHelpPopupPosition.TopCenter) Wires up a SAIFHoverHelp UI element using content resolved from inHelpCollection/inReferenceKey.
ConfigureHoverHelpItem (SAIFHoverHelp/text overload) Public Sub ConfigureHoverHelpItem(ByVal inHoverHelp As SAIFHoverHelp, ByVal inHelpText As String, Optional ByVal inWidth As Integer = 200, Optional ByVal inPopupPosition As HoverHelpPopupPosition = HoverHelpPopupPosition.TopCenter) Wires up a SAIFHoverHelp UI element using a literal help-text string rather than a resolved help collection.

Protected Friend members

Member Signature Purpose
ApplyColumnPreferences (UltraWebGrid) Protected Friend Sub ApplyColumnPreferences(ByVal inGrid As UltraWebGrid, Optional ByRef InSizeDiv As HtmlControls.HtmlGenericControl = Nothing) Applies a user's previously saved column order/width (and, for the first band, size) preferences to an UltraWebGrid, after first capturing the as-designed layout via SaveDefaultLayout.
ApplySortPreferences (UltraWebGrid) Protected Friend Sub ApplySortPreferences(ByVal inGrid As UltraWebGrid) Applies a user's previously saved sort-column/direction preferences to an UltraWebGrid, per band; silently ignores a missing/renamed column key via Try/Catch*.
GetSortPreferenceOrderBy (UltraWebGrid) Protected Friend Function GetSortPreferenceOrderBy(ByVal inGrid As UltraWebGrid, Optional ByVal bandIndex As Integer = 0) As String Builds an ORDER BY-style string from the user's saved sort preference for the given band, for use in a data query.
SavePreferences (UltraWebGrid) Protected Friend Sub SavePreferences(ByVal inGrid As UltraWebGrid, ByVal IncludeSort As Boolean, Optional ByVal Height As Integer = 0, Optional ByVal Width As Integer = 0, Optional ByVal SizeOnly As Boolean = False) Persists the grid's current live column order/width, sort, and size state as the user's preferences.
ClearPreferences (UltraWebGrid) Protected Friend Sub ClearPreferences(ByVal inGrid As UltraWebGrid, Optional ByRef InSizeDiv As HtmlControls.HtmlGenericControl = Nothing) Removes all saved preference keys for the grid and restores the pre-preference default layout.
ApplyColumnPreferences (WebDataGrid) Protected Friend Sub ApplyColumnPreferences(ByVal inGrid As WebDataGrid, Optional ByVal ApplyGridSize As Boolean = False) Applies a user's previously saved column order/width (and, optionally, size) preferences to a WebDataGrid, after first capturing the as-designed layout via SaveDefaultLayout.
ApplySortPreferences (WebDataGrid) Protected Friend Sub ApplySortPreferences(ByVal inGrid As WebDataGrid) Applies a user's previously saved sort-column/direction preferences to a WebDataGrid; silently ignores a missing/renamed column key via Try/Catch*.
GetSortPreferenceOrderBy (WebDataGrid) Protected Friend Function GetSortPreferenceOrderBy(ByVal inGrid As WebDataGrid) As String Builds an ORDER BY-style string from the user's saved sort preference for use in a data query.
SavePreferences (WebDataGrid) Protected Friend Sub SavePreferences(ByVal inGrid As WebDataGrid, ByVal IncludeSort As Boolean, Optional ByVal Height As Integer = 0, Optional ByVal Width As Integer = 0, Optional ByVal SizeOnly As Boolean = False) Persists the grid's current live column order/width, sort, and size state as the user's preferences.
ClearPreferences (WebDataGrid) Protected Friend Sub ClearPreferences(ByVal inGrid As WebDataGrid) Removes all saved preference keys for the grid and restores the pre-preference default layout.
SetErrorColorInGrid Protected Friend Function SetErrorColorInGrid(ByRef inDataGrid As WebDataGrid, Optional ByVal inSetFocusOnFirstError As Boolean = True) As Boolean Highlights grid cells bound to properties with broken BOF business rules using ErrorColor, per BR-AVPB-002; returns True if no errors were found.

Protected members

Member Signature Purpose
GetHoverHelpFromGrid (UltraWebGrid) Protected Function GetHoverHelpFromGrid(ByRef inGrid As Infragistics.WebUI.UltraWebGrid.UltraWebGrid, ByVal inControlName As String) As SAIFHoverHelp Locates a named SAIFHoverHelp control nested inside an UltraWebGrid templated column's header item.
GetHoverHelpFromGrid (WebDataGrid) Protected Function GetHoverHelpFromGrid(ByRef inGrid As Infragistics.Web.UI.GridControls.WebDataGrid, ByVal inControlName As String) As SAIFHoverHelp Locates a named SAIFHoverHelp control nested inside a WebDataGrid template data field's header template container.
GetGridHeaderHelpControl Protected Function GetGridHeaderHelpControl(ByRef inGrid As Infragistics.WebUI.UltraWebGrid.UltraWebGrid, ByVal inControlName As String) As HoverHelp Locates a named legacy HoverHelp control nested inside an UltraWebGrid templated column's header item.

Inherited public members

Members in this section are inherited from SAIF.Presentation.Web.mvc.ViewPageBase (documented in SAIF.Presentation.Web.MVC), and, transitively through it, from System.Web.UI.Page/System.Web.UI.Control. All entries are retrieved from SAIF.Presentation.Web.MVC's own documentation and are listed here directly so this page is self-contained; see that library's ViewPageBase API reference for further detail.

From ViewPageBase (SAIF.Presentation.Web.MVC)

Member Signature Purpose Origin
PageModeEnum Public Enum PageModeEnum Enumerates the page's display mode (e.g., add/edit/view).† SAIF.Presentation.Web.MVC — ViewPageBase
VIEWSTATE_CTRL_ENUM Public Enum VIEWSTATE_CTRL_ENUM Enumerates ViewState-in-session behavior options consumed by the framework's session-based ViewState business rule.† SAIF.Presentation.Web.MVC — ViewPageBase
MessageControl Public Property MessageControl() As Label The page's designated label control for displaying status/error messages to the user.† SAIF.Presentation.Web.MVC — ViewPageBase
PageMode Public Property PageMode() As PageModeEnum The page's current display mode.† SAIF.Presentation.Web.MVC — ViewPageBase
ViewStateInSession Public Property ViewStateInSession() As VIEWSTATE_CTRL_ENUM Configures which users get server-side (session-based) ViewState persistence rather than the default page-embedded ViewState.† SAIF.Presentation.Web.MVC — ViewPageBase
ViewID Public Property ViewID() As String The GUID identifying this page's model/view-data instance in session.† SAIF.Presentation.Web.MVC — ViewPageBase

From System.Web.UI.Page

Member Signature Purpose Origin
IsPostBack Public ReadOnly Property IsPostBack() As Boolean Whether the page is being loaded in response to a client postback, as opposed to a fresh request.† System.Web.UI.Page (via SAIF.Presentation.Web.MVC — ViewPageBase)
Session Public ReadOnly Property Session() As HttpSessionState The current HttpSessionState for the request.† System.Web.UI.Page (via SAIF.Presentation.Web.MVC — ViewPageBase)
Request Public ReadOnly Property Request() As HttpRequest The HttpRequest for the current page request.† System.Web.UI.Page (via SAIF.Presentation.Web.MVC — ViewPageBase)
Response Public ReadOnly Property Response() As HttpResponse The HttpResponse associated with the page.† System.Web.UI.Page (via SAIF.Presentation.Web.MVC — ViewPageBase)
Server Public ReadOnly Property Server() As HttpServerUtility The HttpServerUtility associated with the page.† System.Web.UI.Page (via SAIF.Presentation.Web.MVC — ViewPageBase)
Cache Public ReadOnly Property Cache() As Cache The application-level Cache object for the current request.† System.Web.UI.Page (via SAIF.Presentation.Web.MVC — ViewPageBase)
ClientScript Public ReadOnly Property ClientScript() As ClientScriptManager Manager used to register client-side script blocks.† System.Web.UI.Page (via SAIF.Presentation.Web.MVC — ViewPageBase)
User Public ReadOnly Property User() As IPrincipal The security principal associated with the current request.† System.Web.UI.Page (via SAIF.Presentation.Web.MVC — ViewPageBase)

From System.Web.UI.Control

Member Signature Purpose Origin
Controls Public ReadOnly Property Controls() As ControlCollection Collection of top-level child controls contained within the page.† System.Web.UI.Control (via SAIF.Presentation.Web.MVC — ViewPageBase)
Visible Public Property Visible() As Boolean Whether the control is rendered as UI on the page.† System.Web.UI.Control (via SAIF.Presentation.Web.MVC — ViewPageBase)
DataBind Public Overridable Sub DataBind() Binds a data source to this control and its child controls.† System.Web.UI.Control (via SAIF.Presentation.Web.MVC — ViewPageBase)
FindControl Public Function FindControl(ByVal id As String) As Control Searches the current naming container for a server control with the given ID.† System.Web.UI.Control (via SAIF.Presentation.Web.MVC — ViewPageBase)

Inherited protected/friend members

Members in this section are inherited from SAIF.Presentation.Web.mvc.ViewPageBase (or, transitively, from System.Web.UI.Control) but are not part of the public API surface — they are Protected Friend or Protected and are only usable from this class, its descendants, or (for Protected Friend) other code in the same assembly. They are listed here, separately from Inherited public members, so the public-surface tables above accurately reflect only public members. All entries are retrieved from SAIF.Presentation.Web.MVC's own documentation; see that library's ViewPageBase API reference for further detail.

From ViewPageBase (SAIF.Presentation.Web.MVC)

Member Signature Purpose Origin
HandleApplicationError Protected Friend Overridable Function HandleApplicationError(ByVal ex As Exception) As Boolean Overridable hook giving the concrete page a chance to fully handle an unhandled exception itself before ProcessError continues its dispatch.† SAIF.Presentation.Web.MVC — ViewPageBase

From System.Web.UI.Control

Member Signature Purpose Origin
ViewState Protected ReadOnly Property ViewState() As StateBag Dictionary of view-state values saved/restored across postbacks; ViewPageBase.PageStatePersister governs where this is physically stored.† System.Web.UI.Control (via SAIF.Presentation.Web.MVC — ViewPageBase)
OnInit Protected Overridable Sub OnInit(ByVal e As EventArgs) Raises the Init event.† System.Web.UI.Control (via SAIF.Presentation.Web.MVC — ViewPageBase)
OnLoad Protected Overridable Sub OnLoad(ByVal e As EventArgs) Raises the Load event.† System.Web.UI.Control (via SAIF.Presentation.Web.MVC — ViewPageBase)

Behavioral notes

  • Page_Init defaults EnableSessionPing to True; Page_Load always calls CallSessionPing() and conditionally calls clsControlManager.ResetBackColor when CallResetBackcolor is True.
  • HelpFolderName's getter throws an unhandled ApplicationException if accessed before being set, per BR-AVPB-003.
  • ApplySortPreferences silently ignores a missing/renamed column key via Try/Catch*.

Constraints and usage notes

  • Configure is MustOverride; every concrete descendant page must implement it, typically to set HelpFolderName.
  • SetErrorColorInGrid only operates on WebDataGrid instances bound to BOF clsBusinessBase-derived objects; non-BOF-bound rows are skipped.
  • Session keep-alive depends on a SessionPing.aspx page existing in the consuming application; this is a documented constraint, not enforced in code*.

Note: Statements marked with † are derived from dependency library documentation via the Legends CLI. Statements marked with * were inferred from code structure or contextual evidence. Statements marked with ** could not be confirmed; treat as unknown until verified.

Sources

  • SAIF.Presentation.Web.Core.Infragistics103\AppViewPageBase.aspx.vb
  • SAIF.Presentation.Web.Core.Infragistics103\AppViewPageBase.aspx