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

# ErrorViewModel

The JSON-serializable shape `ModelStateExtensions.GetErrors` emits per model-state entry, carrying a DOM-safe key, the associated error messages, and an optional grid-row correlation id.

## Purpose
- The JSON-serializable shape `ModelStateExtensions.GetErrors` emits per model-state entry, carrying a DOM-safe key, the associated error messages, and an optional grid-row correlation id.

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

## Public members
| Member | Signature | Purpose |
| --- | --- | --- |
| Key | `public string Key { get; set; }` | The model-state key with `.` replaced by `_` for DOM-element-id safety. |
| Values | `public string[] Values { get; set; }` | All error messages associated with the key. |
| GridRowId | `public string GridRowId { get; set; }` | The correlated grid row identifier, or `""` when the key does not participate in grid-row correlation; see [BR-36](../../business-rules.md#br-36-error-keys-are-dom-safe). |

## Sources
- `src/Web.Mvc/ViewModels/ErrorViewModel.cs`
