---
title: MenuExtensions
summary: API reference for MenuExtensions.
status: draft
owner: SAIF Documentation
last_reviewed: 2026-09-17
library: SAIF.Framework.Web.Mvc
reference_type: package
---

# MenuExtensions

Emits the Business Online navigation menu markup — favorites list, all-applications category grouping, and a client-side-consumed top menu — from a `MenuViewModel`/`WebContextViewModel` pair, including a legacy "old school" rendering path for older layouts.

## Purpose
- Emits the Business Online navigation menu markup — favorites list, all-applications category grouping, and a client-side-consumed top menu — from a `MenuViewModel`/`WebContextViewModel` pair, including a legacy "old school" rendering path for older layouts.

## Context
- Namespace: `SAIF.Web.Mvc`
- Assembly/package: `SAIF.Framework.Web.Mvc (source-shipping NuGet package)`
- Kind: static class

## Public members
| Member | Signature | Purpose |
| --- | --- | --- |
| RenderMenu(HtmlHelper, MenuViewModel, WebContextViewModel) | `public static void RenderMenu(this HtmlHelper helper, MenuViewModel menu, WebContextViewModel webContext)` | Writes the favorites list and full category-grouped menu to the view writer; see the "Render the Business Online menu" operation. |
| RenderTopMenu(HtmlHelper, MenuViewModel, WebContextViewModel) | `public static void RenderTopMenu(this HtmlHelper helper, MenuViewModel menu, WebContextViewModel webContext)` | Writes only the items belonging to the menu's current category. |
| FavoriteLink(MenuItemViewModel) | `private static string FavoriteLink(MenuItemViewModel item)` | Builds a single favorite `<a>` element, falling back to `PageName` when `FavoriteName` is blank. |
| MenuLink(MenuItemViewModel) | `private static string MenuLink(MenuItemViewModel item)` | Builds a single category-menu `<a>` element. |
| RenderOldSchoolMenu(HtmlHelper, MenuViewModel, WebContextViewModel) | `public static MvcHtmlString RenderOldSchoolMenu(this HtmlHelper helper, MenuViewModel menu, WebContextViewModel webContext)` | Legacy variant of `RenderMenu` returning markup instead of writing it, using `MenuLink` for favorites rather than `FavoriteLink`. |
| RenderOldSchoolTopMenu(HtmlHelper, MenuViewModel, WebContextViewModel) | `public static MvcHtmlString RenderOldSchoolTopMenu(this HtmlHelper helper, MenuViewModel menu, WebContextViewModel webContext)` | Legacy variant of `RenderTopMenu` returning markup instead of writing it. |

## Behavioral notes
- The legacy `RenderOldSchool*` helpers render favorites through `MenuLink`, so favorite names and category tooltips are not applied on that path.

> **Note:** Statements marked with * were inferred from code structure, naming conventions, or
> contextual evidence where direct confirmation was not available in source artifacts. Statements
> marked with ** could not be confirmed; treat as unknown until verified.

## Sources
- `src/Web.Mvc/Extensions/MenuExtensions.cs`
