---
title: SAIFWarp pre-render error/init script registration
summary: Wires the async-refresh error handler and progress-indicator init script before the control renders.
status: draft
owner: SAIF Documentation Team
last_reviewed: 2026-08-17
library: SAIF.Presentation.Web.Controls.Infragistics103
reference_type: package
operation_id: OP-SAIFWARP-PRERENDER
trigger: ASP.NET PreRender event of the SAIFWarp control
---

# SAIFWarp pre-render error/init script registration

This operation runs during the `PreRender` phase of the ASP.NET page lifecycle for a `SAIFWarp` control, wiring the central async-refresh error-handling behavior and registering the progress-indicator initialization script.

| Field | Value |
| --- | --- |
| **Operation ID** | OP-SAIFWARP-PRERENDER |
| **Trigger** | ASP.NET `PreRender` event of `SAIFWarp` |
| **Inputs** | `Page` context |
| **Outputs** | Registered startup/client scripts, `ClientSideEvents.Error` wiring |
| **Primary components** | `SAIFWarp.SAIFWarp_PreRender`, `SAIFWarp.GetScriptWithMessage` |
| **Entry point** | SAIF.Presentation.Web.Controls.Infragistics103\SAIFWarp.vb |

## Steps

1. If `Not DesignMode`: set `ClientSideEvents.Error = ERROR_SCRIPT_BLOCK_NAME`.
2. If the `ERROR_SCRIPT_BLOCK_NAME` startup script is not already registered, register it with the message produced by `GetScriptWithMessage(DEFAULT_ERROR)`. This script (`SAIFWarp_Error`) navigates the browser to `/weberror/processError.aspx?MSG={message}` when the async-refresh error `flags` value is greater than 1 ([BR-4](../business-rules.md#br-4-async-refresh-error-redirects-to-central-error-page)).
   - On failure (`flags > 1`): the browser navigates away from the async panel context to the shared error-handling screen.
3. If the `INIT_SCRIPT_NAME` client script block is not already registered, register `INIT_SCRIPT`, which defines `WARP_Init` — sets the panel's progress-indicator image URL to `/Resources/Images/saif_progressIndicator.gif`.

## Process flow

The following diagram visualizes this operation's control flow.

```mermaid
flowchart TD
	Start([PreRender event fires]) --> Design{DesignMode?}
	Design -->|No| SetError[Set ClientSideEvents.Error]
	Design -->|Yes| SkipError[Skip error wiring]
	SetError --> CheckErr{Error script already registered?}
	SkipError --> CheckErr
	CheckErr -->|No| RegErr[Register SAIFWarp_Error startup script]
	CheckErr -->|Yes| CheckInit
	RegErr --> CheckInit{Init script already registered?}
	CheckInit -->|No| RegInit[Register WARP_Init client script]
	CheckInit -->|Yes| EndOk
	RegInit --> EndOk([PreRender complete])
```

## Failure and edge-case behavior
- `flags > 1` on the client-side async-refresh error event: browser navigates to `/weberror/processError.aspx?MSG={message}` per [BR-4](../business-rules.md#br-4-async-refresh-error-redirects-to-central-error-page).
- At design time, the error `ClientSideEvents` wiring is skipped.

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

## Sources
- SAIF.Presentation.Web.Controls.Infragistics103\SAIFWarp.vb
