Required Fields
This is the big one that takes out those input statements!
It checks to see if the ControltoValidate has some sort of value in it, if it
does have something, then its IsValid property is set to True.
Enter your name (First & Last):
<asp:TextBox id="FName" runat="server" /><br>
<asp:RequiredFieldValidator runat="Server"
ControltoValidate="FName" ErrorMessage="You didn't fill in your name"/> |
If the user doesn't enter anything in the textbox, the
message - "You didn't fill in your name" appears in Red where the Validator
is. You can put validators anywhere and the message just appears there.