---
title: Banner rendering and logout
summary: Renders site banner chrome varying by internal/external client context, and handles the logout postback.
status: draft
owner: SAIF Documentation Team
last_reviewed: 2026-08-17
library: SAIF.Presentation.Web.Controls.V2
reference_type: package
operation_id: OP-V2-BANNER-001
trigger: ASP.NET render pipeline (OnInit/Render); logout LinkButton postback
---

# Banner rendering and logout

This operation renders the SAIF site banner (via `BannerControl` or its revised successor `BannerControlV2`) and handles the interactive logout flow raised from the banner's logout link.

| Field | Value |
| --- | --- |
| **Operation ID** | OP-V2-BANNER-001 |
| **Trigger** | Page containing the control executes the ASP.NET render pipeline (`OnInit` → `Render`); logout is triggered by a postback from the rendered "Logout" `LinkButton`. |
| **Inputs** | `AppGlobal.EnvironmentService.IsClientExternal`, current virtual directory name, `SITEBANNER.XML`/`SITEBANNERV2.XML` file content, `PrintPageTitle`/`DisplayBannerLogout`/`DisplayBannerFeedback` properties. |
| **Outputs** | HTML banner markup (print and/or display variants) written to the `HtmlTextWriter`; on logout, an HTTP redirect. |
| **Primary components** | `BannerControl.OnInit`/`Render`/`FeedbackHelpLogout_Click`, `BannerControlV2` (equivalent members). |
| **Entry point** | `SAIF.Presentation.Web.Controls.V2\Banner.vb`, `SAIF.Presentation.Web.Controls.V2\BannerControlV2.vb` |

## Steps

1. `OnInit` calls `SetBannerControlDefaults()` (skipped in design mode) — determines `m_Insider` from `IsClientExternal`, sets default visibility of feedback/logout/banner sections ([BR-V2-001](../business-rules.md#br-v2-001-internal-clients-suppress-default-bannerlogoutfeedback-visibility)), resolves `m_resourcesPath` to the banner XML file via `HttpContext.Current.Server.MapPath`, and sets `LoggingIn` to true if the current app folder is `"ONLINELOGIN"` ([BR-V2-002](../business-rules.md#br-v2-002-login-app-suppresses-logoutfeedback-popout-behavior)).
2. `Render` branches:
   - If `Context Is Nothing` (design-time): writes a static placeholder banner `<div>`.
   - If the resource path is empty: exits without rendering (no banner shown) — pure fallback behavior, not an error.
3. Loads `m_BannerXML` from the resolved file and extracts the `print` node — always rendered via `RenderPrintBanner` regardless of internal/external context.
4. If `ShowInternalDisplayBanner` is false, exits before rendering the interactive display banner.
5. Otherwise extracts the `display` node, splits its markup around a `[LINKS]` placeholder, and renders (in `BannerControlV2`) the SAIF.com link, logout link (if `DisplayBannerLogout And Not LoggingIn`), feedback link/anchor (varies by `LoggingIn`), and remaining split text.
6. On logout link click (`FeedbackHelpLogout_Click`, handled `Handles m_LogoutLink.Click`):
   - Abandons the session (`Session.Abandon()`).
   - Sets response cache/expiry headers.
   - Clears `ASP.NET_SessionId` and `SAIFAUTH` cookies.
   - Redirects to `/OnlineLogin/loginscreen.aspx`.
   - Raises the public `MenuNavigate` event for any host page listeners.

## Process flow

The following diagram visualizes this operation's control flow.

```mermaid
flowchart TD
	Start([Render pipeline OnInit]) --> S1[SetBannerControlDefaults]
	S1 --> S2{Design mode?}
	S2 -->|Yes| PH[Write static placeholder banner]
	S2 -->|No| S3{Resource path empty?}
	S3 -->|Yes| NoRender([No banner rendered])
	S3 -->|No| S4[Load banner XML, render print node]
	S4 --> S5{ShowInternalDisplayBanner?}
	S5 -->|No| Done1([Print banner only])
	S5 -->|Yes| S6[Render display banner with links]
	S6 --> Postback{Logout link clicked?}
	Postback -->|Yes| Logout[Session.Abandon, clear cookies, raise MenuNavigate]
	Logout --> Redirect([Redirect to /OnlineLogin/loginscreen.aspx])
	Postback -->|No| Done2([Rendered banner HTML])
```

## Failure and edge-case behavior

- Design-time rendering (`Context Is Nothing`) short-circuits to a static placeholder, bypassing the XML resource read entirely.
- An empty resolved resource path silently suppresses all banner rendering — no exception is raised.
- No delegation into other libraries occurs beyond reading the framework-provided `AppGlobal.EnvironmentService`*.

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

## Sources
- SAIF.Presentation.Web.Controls.V2\Banner.vb
- SAIF.Presentation.Web.Controls.V2\BannerControlV2.vb
