C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Resources » Code Snippets » ASP.NET WebForms »

ASP.NET Validation Controls


Posted Date: 30 Nov 2008    Resource Type: Code Snippets    Category: ASP.NET WebForms
Author: Arun JacobMember Level: Gold    
Rating: 1 out of 5Points: 3



1.RequiredFieldValidator - is using for checking empty data or checking an initial value.


<asp:RequiredFieldValidator ID="reqValidator" runat="server"
ErrorMessage="Enter Password" ControlToValidate="txtPassword"
SetFocusOnError="True">?</asp:RequiredFieldValidator>


2.RegularExpressionValidator - is using for checking the data based upon a regular expression.


<asp:RegularExpressionValidator ID="regValidator" runat="server"
ErrorMessage="Invalid mail address" ControlToValidate="txtMail"
SetFocusOnError="True"
ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*">?</asp:RegularExpressionValidator>


3.RangeValidator - is using for checking whether the input is in a range as we specified.



<asp:RangeValidator ID="ranValidator" runat="server"
ErrorMessage="Invalid data" ControlToValidate="txtPassword"
MaximumValue="100" MinimumValue="0" SetFocusOnError="True" Type="Double">?</asp:RangeValidator>


4.CompareValidator - is using for comparing two controls.


<asp:CompareValidator ID="cmpValidator" runat="server"
ErrorMessage="Retype password" ControlToCompare="txtPassword"
ControlToValidate="txtRePassword">?</asp:CompareValidator>


5.CustomValidator - we can check with custom function.

:-)




Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Sign In to add tags.
ASP.NET Validation Controls  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Caching
Previous Resource: Difference between two dates in ASP.Net using VB.net
Return to Discussion Resource Index
Post New Resource
Category: ASP.NET WebForms


Post resources and earn money!
 
Related Resources



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use