---
title: Resolve current menu item / page identity
summary: Resolves the authorized menu item matching the current page's application, category, and link.
status: draft
owner: SAIF Documentation Team
last_reviewed: 2026-08-17
library: SAIF.Presentation.Web.Core.Infragistics103
reference_type: package
operation_id: OP-NC-002
trigger: Page code requests its own menu/page identity
---

# Resolve current menu item / page identity

This operation resolves the currently-authorized menu item (or page) for the running page, by matching the application code, category, and link against the previously loaded authorized item set.

| Field | Value |
| --- | --- |
| **Operation ID** | OP-NC-002 |
| **Trigger** | Page code requesting its own menu/page identity (e.g. to control breadcrumb/help/authorization display) |
| **Inputs** | Category string and/or current `HttpContext.Current.Request` URL |
| **Outputs** | A `clsMenuAuthorizedItem` or `Nothing` |
| **Primary components** | `NavigationContext.GetCurrentItem`, `GetCurrentPage`, `GetItem`, `GetItemSeq`, `IsMenuItem` |
| **Entry point** | `SAIF.Presentation.Web.Core.Infragistics103\NavigationContext.vb` |

## Steps

1. Derives `appPath` from `HttpContext.Current.Request.ApplicationPath` (strips `/`) and, for `GetCurrentItem`/`GetCurrentPage`, derives `PageLink` from `Request.RawUrl` relative to the application path.
2. Looks up the app code via `ApplicationCodes.ItemByAppPath(appPath)` (cached statically the first time via `clsApplicationCodeCollection.GetActiveApplicationCodes`).
3. If an app code is found, attempts an exact match first: `MenuAuthorizedItems.ItemExact(AppCode, category, link, True)` — enforces [BR-NC-002](../business-rules.md#br-nc-002-exact-match-is-preferred-over-fallback-match-for-menu-resolution).
4. If no exact match, falls back to a looser `MenuAuthorizedItems.Item(AppCode, category, link, True)` match by category/link only.
   - If no app code was resolved (`AppCode` empty): the method returns `Nothing`/empty result without further lookup.
5. `GetItemSeq` and `IsMenuItem` follow the analogous app-code → item-lookup pattern to return a sequence number or a boolean existence check, respectively.

## Process flow

The following diagram visualizes this operation's control flow.

```mermaid
flowchart TD
	Start([Request page identity]) --> S1[Derive appPath / PageLink from request]
	S1 --> S2[Look up ApplicationCode by app path]
	S2 --> D1{App code found?}
	D1 -->|No| EndNothing([Return Nothing])
	D1 -->|Yes| S3[Attempt ItemExact match]
	S3 --> D2{Exact match found?}
	D2 -->|Yes| EndExact([Return exact match])
	D2 -->|No| S4[Fall back to Item loose match]
	S4 --> EndLoose([Return loose match or Nothing])
```

## Failure and edge-case behavior
- If the application code itself cannot be resolved, `Nothing` is returned without attempting any item lookup.

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

## Sources
- SAIF.Presentation.Web.Core.Infragistics103\NavigationContext.vb
