Skip to content

Commit

Permalink
Included how to add error message without validation
Browse files Browse the repository at this point in the history
  • Loading branch information
dannylloyd committed Jun 12, 2013
1 parent bfed762 commit a222f6a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion README.md
Expand Up @@ -5,7 +5,12 @@ ASP.NET Web Forms bootstrap and validation helpers

txtFirstName.Validate("First name").Required().Length(7)
txtLastName.Validate("Last name").Required().Length(5)
txtAge.Validate("Age").IsInteger().WhenControlIsValid(txtFirstName).Required().ApplyRule(AddressOf IsNotOld, "Too old")
txtAge.Validate("Age").IsInteger().WhenControlIsValid(txtFirstName).Required()
.ApplyRule(AddressOf IsNotOld, "Too old")
txtStartDate.Validate("Start date").Required().IsDate()
txtEndDate.Validate("End date").IsDate()
txtTitle.Validate("Title").When(chkTitleRequired.Checked).Required()

To add an arbitrary error message

FormState.AddError("Must enter at least one search criteria", txtFirstName)

0 comments on commit a222f6a

Please sign in to comment.