C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Interview   Jobs   Projects   Offshore Development    
Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing | Talk to Us |



My Profile

Gifts

Active Members
TodayLast 7 Days more...







ValidateExpression for Day,Month and Year


Posted Date: 11 Mar 2008    Resource Type: Code Snippets    Category: Regular Expressions

Posted By: Jessica       Member Level: Gold
Rating:     Points: 7



The code sample contains basic validation expressions generally needed in every application. Users should be allowed to enter only valid day,month and year values for a particular date.

In this code snippet uses regular expression validator and sets it's validation expression property. This example is very useful when clients don't need calender control.

ValidationExpression for Day

Day: ValidationExpression="^((([1-9]?)|([1-2][0-9])?)|([3][0-1]?))$"


ValidationExpression for Month


ValidationExpression="^((([1-9]?)|([0][1-9])?)|([1][0-2]?))$"


ValidationExpression for Year


ValidationExpression="[0-9]{4}"






Responses

Author: Balthazor    01 Apr 2008Member Level: Diamond   Points : 0
That help me


Author: ravi    16 Jul 2008Member Level: Gold   Points : 1
good stuff but can u post a code that validates a date?

if found please mail to my gmail


Feedbacks      
Popular Tags   What are tags ?   Search Tags  
ValidateExpression for Year  .  ValidateExpression for Month  .  ValidateExpression for Day  .  Validate date using ValidateExpression  .  Using ValidateExpression  .  Month and Year  .  

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: How to use the Regex.Split() to split strings in C# ?
Previous Resource: How to remove trailing & leading spaces with regular expression in c#
Return to Discussion Resource Index
Post New Resource
Category: Regular Expressions


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design

doors in nj

Contact Us    Privacy Policy    Terms Of Use