---
title: Initialize page (session ping + control reset)
summary: Wires session keep-alive and normalizes control back colors during the ASP.NET page lifecycle.
status: draft
owner: SAIF Doc Gen
last_reviewed: 2026-08-17
library: SAIF.Presentation.Web.Core.Infragistics111
reference_type: package
operation_id: OP-CORE-001
trigger: ASP.NET page lifecycle Init and Load events of any page deriving from AppViewPageBase
---

# Initialize page (session ping + control reset)

Every page that inherits `AppViewPageBase` runs this operation on the standard ASP.NET `Init`/`Load` lifecycle. It enables session keep-alive by default (unless the client is external) and normalizes control back-color styling so form fields render consistently across postbacks.

| Field | Value |
| --- | --- |
| **Operation ID** | OP-CORE-001 |
| **Trigger** | ASP.NET page lifecycle `Init` and `Load` events |
| **Inputs** | `EnableSessionPing`, `CallResetBackcolor`, environment client classification |
| **Outputs** | Registered client script blocks; CSS classes reset on every control in the page tree |
| **Primary components** | `AppViewPageBase.Page_Init`, `AppViewPageBase.Page_Load`, `AppViewPageBase.CallSessionPing` |
| **Entry point** | `SAIF.Presentation.Web.Core.Infragistics111/AppViewPageBase.aspx.vb` |

## Steps

1. On `Init`, set `EnableSessionPing = True` and call the designer `InitializeComponent`. ([BR-CORE-001](../business-rules.md#br-core-001-session-keep-alive-is-enabled-by-default-on-every-saif-application-page))
2. On `Load`, call `CallSessionPing()`.
3. In `CallSessionPing`, if `EnableSessionPing` is `False`, exit immediately without registering any script.
4. Query `AppGlobal.EnvironmentService.IsClientExternal`. ([BR-CORE-002](../business-rules.md#br-core-002-session-keep-alive-scripts-are-never-emitted-to-externally-classified-clients))
   - If the client is external: skip script registration entirely and return.
   - > **Origin**: This step delegates to `AppGlobal.EnvironmentService.IsClientExternal`, provided by the SAIF framework environment service (package `SAIF.BOF.Framework`). The callee's internal classification logic is not implemented in this repository and could not be traced.**
5. Build a script include for `/resources/scripts/PingSession.js` and a startup script calling `InitializeSessionPing()`.
   - If the `SessionPing` script block is already registered on the page: skip registration (no duplicate). ([BR-CORE-003](../business-rules.md#br-core-003-the-session-ping-script-is-registered-at-most-once-per-page))
   - Otherwise: register both script blocks via `ClientScript`.
6. Back in `Load`, evaluate `CallResetBackcolor`.
   - If `True`: call `Utilities.clsControlManager.ResetBackColor(Me)`. ([BR-CORE-004](../business-rules.md#br-core-004-control-back-colors-are-re-normalized-on-every-page-load-unless-the-page-opts-out)) > **Origin**: Step 6's back-color normalization is fully implemented in [Reset control back colors](reset-control-back-colors.md) (`SAIF.Presentation.Web.Core.Infragistics111`, this library) — see that page for the recursive control-tree logic.
   - If `False`: no back-color reset occurs this cycle.

## Process flow

The following diagram visualizes this operation's control flow.

```mermaid
flowchart TD
	Start([Page Init/Load]) --> S1["Page_Init: EnableSessionPing = True"]
	S1 --> S2[Page_Load: CallSessionPing]
	S2 --> D1{EnableSessionPing?}
	D1 -->|No| EndSkip([No script registered])
	D1 -->|Yes| D2{IsClientExternal?}
	D2 -->|Yes| EndSkip
	D2 -->|No| D3{SessionPing already registered?}
	D3 -->|Yes| EndOk([Ping active])
	D3 -->|No| S3[Register PingSession.js + startup script]
	S3 --> EndOk
	S2 --> D4{CallResetBackcolor?}
	D4 -->|Yes| S4[ResetBackColor recurses page tree]
	D4 -->|No| EndNoReset([Colors unchanged])
	S4 --> EndOk
```

## Failure and edge-case behavior

- If `AppGlobal.EnvironmentService` is unavailable, the client-classification query would fail; this library assumes the environment service is always present at runtime.**
- Repeated `Load` events (e.g. partial postbacks) never duplicate the ping script because of the registered-block check in step 5.

## Related documentation
- [Operations and processes](../operations-processes.md)
- [Business rules](../business-rules.md)

## Sources
- `SAIF.Presentation.Web.Core.Infragistics111/AppViewPageBase.aspx.vb`
