Table of Contents

Class ModelStateExtensions

Namespace
Umbraco.Extensions
Assembly
Umbraco.Web.Common.dll
public static class ModelStateExtensions
Inheritance
ModelStateExtensions
Inherited Members

Methods

IsValid(ModelStateDictionary, string)

Checks if there are any model errors on any fields containing the prefix

public static bool IsValid(this ModelStateDictionary state, string prefix)

Parameters

state ModelStateDictionary
prefix string

Returns

bool

ToErrorDictionary(ModelStateDictionary)

public static IDictionary<string, object> ToErrorDictionary(this ModelStateDictionary modelState)

Parameters

modelState ModelStateDictionary

Returns

IDictionary<string, object>

ToJsonErrors(ModelStateDictionary)

Serializes the ModelState to JSON for JavaScript to interrogate the errors

public static JsonResult ToJsonErrors(this ModelStateDictionary state)

Parameters

state ModelStateDictionary

Returns

JsonResult