Class StaticValidator
Validator that can be used to indicate validation errors that have been handled programmatically.
Inheritance
Implements
Namespace: EPiServer.Web.WebControls
Assembly: EPiServer.Cms.AspNet.dll
Version: 11.20.7Syntax
public class StaticValidator : BaseValidator, IValidator
Constructors
StaticValidator()
Initializes a new instance of the StaticValidator class.
Declaration
public StaticValidator()
StaticValidator(String)
Initializes a new instance of the StaticValidator class.
Declaration
public StaticValidator(string errorMessage)
Parameters
Type | Name | Description |
---|---|---|
System.String | errorMessage | The error message. |
Remarks
The error message will by default be HTML encoded
StaticValidator(String, Boolean)
Initializes a new instance of the StaticValidator class.
Declaration
public StaticValidator(string errorMessage, bool htmlEncodeErrorMessage)
Parameters
Type | Name | Description |
---|---|---|
System.String | errorMessage | The error message. |
System.Boolean | htmlEncodeErrorMessage | If the error message should be encoded |
Methods
ControlPropertiesValid()
Determines whether the control specified by the System.Web.UI.WebControls.BaseValidator.ControlToValidate property is a valid control.
Declaration
protected override bool ControlPropertiesValid()
Returns
Type | Description |
---|---|
System.Boolean |
EvaluateIsValid()
When overridden in a derived class, this method contains the code to determine whether the value in the input control is valid.
Declaration
protected override bool EvaluateIsValid()
Returns
Type | Description |
---|---|
System.Boolean | true if the value in the input control is valid; otherwise, false. |
Remarks
Since this control is programatically added when an errormessage should be displayed it always returns false.
Render(HtmlTextWriter)
Writes the error message inside an <span class="errormessage"> tag
Declaration
protected override void Render(HtmlTextWriter output)
Parameters
Type | Name | Description |
---|---|---|
System.Web.UI.HtmlTextWriter | output | The output. |