C# 클래스 Rebel.Cms.Web.ModelStateExtensions

파일 보기 프로젝트 열기: RebelCMS/rebelcmsxu5

공개 메소드들

메소드 설명
AddDataValidationError ( this state, string errorMessage ) : void

Adds an error to the model state that has to do with data validation, this is generally used for JSON responses

IsValid ( this state, string prefix ) : bool

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

Merge ( this state, ModelStateDictionary dictionary, string prefix ) : void

Merges ModelState that has names matching the prefix

ToJsonErrors ( this state ) : System.Web.Mvc.JsonResult

Serializes the ModelState to JSON for JavaScript to interrogate the errors

메소드 상세

AddDataValidationError() 공개 정적인 메소드

Adds an error to the model state that has to do with data validation, this is generally used for JSON responses
public static AddDataValidationError ( this state, string errorMessage ) : void
state this
errorMessage string
리턴 void

IsValid() 공개 정적인 메소드

Checks if there are any model errors on any fields containing the prefix
public static IsValid ( this state, string prefix ) : bool
state this
prefix string
리턴 bool

Merge() 공개 정적인 메소드

Merges ModelState that has names matching the prefix
public static Merge ( this state, ModelStateDictionary dictionary, string prefix ) : void
state this
dictionary ModelStateDictionary
prefix string
리턴 void

ToJsonErrors() 공개 정적인 메소드

Serializes the ModelState to JSON for JavaScript to interrogate the errors
public static ToJsonErrors ( this state ) : System.Web.Mvc.JsonResult
state this
리턴 System.Web.Mvc.JsonResult