Validator.Range Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
Range(Double, Double, String) |
Defines a validation test that tests whether a decimal number falls within a specific range. |
Range(Int32, Int32, String) |
Defines a validation test that tests whether an integer value falls within a specific range. |
Range(Double, Double, String)
Defines a validation test that tests whether a decimal number falls within a specific range.
public static System.Web.WebPages.IValidator Range (double minValue, double maxValue, string errorMessage = default);
static member Range : double * double * string -> System.Web.WebPages.IValidator
Public Shared Function Range (minValue As Double, maxValue As Double, Optional errorMessage As String = null) As IValidator
Parameters
- minValue
- Double
The minimum value. The default is 0.
- maxValue
- Double
The maximum value.
- errorMessage
- String
The error message to display if validation fails.
Returns
The validation test.
Applies to
Range(Int32, Int32, String)
Defines a validation test that tests whether an integer value falls within a specific range.
public static System.Web.WebPages.IValidator Range (int minValue, int maxValue, string errorMessage = default);
static member Range : int * int * string -> System.Web.WebPages.IValidator
Public Shared Function Range (minValue As Integer, maxValue As Integer, Optional errorMessage As String = null) As IValidator
Parameters
- minValue
- Int32
The minimum value. The default is 0.
- maxValue
- Int32
The maximum value.
- errorMessage
- String
The error message to display if validation fails.
Returns
The validation test.