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
ModelStateDictionaryprefix
string
Returns
ToErrorDictionary(ModelStateDictionary)
public static IDictionary<string, object> ToErrorDictionary(this ModelStateDictionary modelState)
Parameters
modelState
ModelStateDictionary
Returns
ToJsonErrors(ModelStateDictionary)
Serializes the ModelState to JSON for JavaScript to interrogate the errors
public static JsonResult ToJsonErrors(this ModelStateDictionary state)
Parameters
state
ModelStateDictionary