Validation in ASP.NET
page 2 of 9
by . .
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 32941/ 100

Required Fields

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.

View Entire Article

User Comments

Title: Nice   
Name: Nagesh
Date: 2004-07-13 9:49:31 AM
Thanks for such quick review ....
Title: GOOD   
Date: 2004-07-13 8:28:00 AM
But where is the code!!!!!!!!!!!!!!!!!

Product Spotlight
Product Spotlight 

Community Advice: ASP | SQL | XML | Regular Expressions | Windows

©Copyright 1998-2021  |  Page Processed at 2021-03-04 8:27:36 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search