You need validation because users make mistakes. The wrong input could result in misplaced orders, inaccurate records, and can even corrupt your database. Validation gets the user to fix those errors before they get anywhere near your data.
Set the button's
RequiredFieldValidator— in the
case of a radio button list, you've already defined the choices for the
user, so you don't need to validate the form or type of input; you just
need to make sure that they chose something.
Display property is set to
Static, the validator takes up a
fixed amount of room, even if it's not displaying a message. When it's
Dynamic, the control is only
rendered when there's a validation error, which can cause other controls
to move around.
set the InitialValue property to "Choose a payment method."
It enables you to place all the validation error messages in one spot on the page, instead of next to each control.
CompareValidator. You can
compare the quantity the user ordered with the amount of inventory in
your database, and make sure that the amount the user wants is equal to
or less than the amount you have.
Use a NoSnoreValidation control, to make sure none of the guests snore
too loudly. Just kidding. Use a
RangeValidator. Set the
MinimumValue to 2, and the
MaximumValue to 5.
RegularExpressionValidator. The Regular Expression Editor has an option that provides ...