# System.Web.WebPages.Razor

**Kind:** Service

**Source:** `Pams/Logic/Pams.Business/Pams.Business.csproj` (line 1)

**Part of:** [Pams](subsystem-pams)

NuGet package dependency

`System.Web.WebPages.Razor` is a NuGet package dependency declared in the legacy-format `Pams.Business.csproj` project. It provides Razor Web Pages runtime support for ASP.NET components that render Razor-based views or pages within the Pams application.

## Diagram

```mermaid
sequenceDiagram
    participant Client
    participant WebApp as ASP.NET Web Application
    participant Razor as System.Web.WebPages.Razor
    participant View as Razor View

    Client->>WebApp: Request page
    WebApp->>Razor: Resolve Razor runtime
    Razor->>View: Parse and render markup
    View-->>Razor: Rendered HTML
    Razor-->>WebApp: Rendered response content
    WebApp-->>Client: HTML response
```

## Usage

```typescript
async function loadPamsPage(path: string): Promise<string> {
  const response = await fetch(path, {
    headers: {
      Accept: "text/html"
    }
  });

  if (!response.ok) {
    throw new Error(`Page request failed: ${response.status}`);
  }

  return response.text();
}

loadPamsPage("/Reports/Index")
  .then((html) => {
    document.getElementById("report-content")!.innerHTML = html;
  })
  .catch((error) => {
    console.error(error);
  });
```

## AI Coding Instructions

- Treat `System.Web.WebPages.Razor` as a project-level NuGet dependency rather than an application service endpoint.
- Keep package references compatible with the legacy project format in `Pams.Business.csproj`.
- Check Razor runtime version compatibility when updating related ASP.NET Web Pages or MVC packages.
- Do not add browser-side dependencies on this package; Razor rendering occurs on the ASP.NET server.

## Used by

4 references from 4 files. Each is a place in this repository where the symbol is actually used — go read one rather than trusting an example.

### Injected or called by (4)

- `Pams.API` — `Pams/API/Pams.API/Pams.API.csproj`:1
- `Pams.Core` — `Pams/Core/Pams.Core/Pams.Core.csproj`:1
- `Pams.Security` — `Pams/Core/Pams.Security/Pams.Security.csproj`:1
- `Pams.Business` — `Pams/Logic/Pams.Business/Pams.Business.csproj`:1
