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

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
Comment:
Thanks for such quick review ....
Title: GOOD   
Name: NAGESH
Date: 2004-07-13 8:28:00 AM
Comment:
But where is the code!!!!!!!!!!!!!!!!!

Product Spotlight
Product Spotlight 





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


©Copyright 1998-2019 ASPAlliance.com  |  Page Processed at 2019-04-21 8:49:13 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search