I'm not sure why this isn't working, and I hoped someone can give a suggestion. I'm trying to use the Range Validator to validate a Long to verify it's between 1 and 9999999999, basically a 1 to 10 digit number, but it's not working. Here's a snippet from my
Class (cAccount) doing the validation:
<RangeValidator(1, RangeBoundaryType.Inclusive, 9999999999, RangeBoundaryType.Inclusive, MessageTemplate:="Loan ID must be 1 to 10 digits")> _
Property ID() As Long
Set(ByVal value As Long)
_ID = value
And from my form here's the code to validate:
Dim Account as cAccount
Dim validator As Validator(Of cAccount) = ValidationFactory.CreateValidator(Of cAccount)()
Dim results As ValidationResults = validator.Validate(Account )
Account.ID = txtAccountID.Text
For Each result As ValidationResult In results
If result.Key.ToString = "ID" Then
lblLoanIDError.Text = result.Message.ToString
Each time I run this, it doesn't validate no matter what. I even tried adding a ruleset, but still no dice. Whether I type in 1 or 100 or 9999999998 it still shows no validation.
Can someone tell what I have wrong? I copied the gist of this from the Validation quickstart.