It also may change attribute's value if normalization or IPv6 expansion is enabled.
The validator has such configuration options: This validator does not perform data validation.
msdn's doc on Range Validator class isn't precise enough, at least not the part I looked at.
For comparing a date against a fixed value, you can simply use the date validator and specify its $min or $max property.
If you need to compare two dates entered in the form, e.g.
Say, I can simply set a Regular Expression Validator's Validation Expression to "(\s|.)" if i wanted to make sure an input has at most 5 characters. I tried setting Range Validator's min value to 1 space, and max value to "~~~~~" because ascii value of a space is 32, and ascii value of "~" is 127.
I was hoping the validator checks the input lexigraphically, but it did not work. I think Range Validator is not a good validator to validate the length of the string.
Info: How to determine if a value is empty or not is a separate topic covered in the Empty Values section.
Default value from database schema could be loaded via load Default Values() method of the model. If you do not specify them, they will take the values of the attribute and the model class being validated. intval, boolval, ...) to ensure a specific type for an attribute, you can simply specify the function names of the filter without the need to wrap them in a closure: This validator checks if the input value represents a valid image file.You'd better use Regular Expression Validator to validate it.Range validator control is a validator control which checks to see if a control value is within a valid range.Use the Required Field Validator control to make the field required. The validation will not fail if the input value cannot be converted to the data type specified.Use the Compare Validator control, with its Operator property set to Validation Compare Operator. The types are: Here is the exact function used by the client-side validation code to compare two values: function Validator Compare(operand1, operand2, operator, val) Here is the evaluation function for the Range Validator.See Security best practices article to learn more about threats prevention when developing applications.