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