How do you validate Date by using which validation Control?

Answers were Sorted based on User's Feedback



How do you validate Date by using which validation Control?..

Answer / kamalakannan.a

<asp:regularexpressionvalidator id="regExpDate"
runat="server"

ValidationExpression="^\d{2}[\/-]\d{2}[\/-]\d{2,4}$"

ErrorMessage="It is not a valid date"
ControlToValidate="txtpatientvisitdate"
EnableClientScript="False"
Display="Dynamic"></asp:regularexpressionvalidator>

Kamal..

Is This Answer Correct ?    12 Yes 2 No

How do you validate Date by using which validation Control?..

Answer / arunajyothi.m

<asp:RegularExpressionValidator ID="revEndDate"
ControlToValidate="txtEndDate" ValidationExpression="((^
(10|12|0?[13578])([/])(3[01]|[12][0-9]|0?[1-9])([/])((1[8-9]
\d{2})|([2-9]\d{3}))$)|(^(11|0?[469])([/])(30|[12][0-9]|0?
[1-9])([/])((1[8-9]\d{2})|([2-9]\d{3}))$)|(^(0?2)([/])(2[0-
8]|1[0-9]|0?[1-9])([/])((1[8-9]\d{2})|([2-9]\d{3}))$)|(^(0?
2)([/])(29)([/])([2468][048]00)$)|(^(0?2)([/])(29)([/])
([3579][26]00)$)|(^(0?2)([/])(29)([/])([1][89][0][48])$)|(^
(0?2)([/])(29)([/])([2-9][0-9][0][48])$)|(^(0?2)([/])(29)
([/])([1][89][2468][048])$)|(^(0?2)([/])(29)([/])([2-9][0-9]
[2468][048])$)|(^(0?2)([/])(29)([/])([1][89][13579][26])$)|
(^(0?2)([/])(29)([/])([2-9][0-9][13579][26])$))"
SetFocusOnError="True" Display="Dynamic"
runat="server">*</asp:RegularExpressionValidator>

Is This Answer Correct ?    3 Yes 0 No

How do you validate Date by using which validation Control?..

Answer / marcelo becerra e

You can use the compare validator control.
you only have to set the OPERATOR to "DATATYPECHECK" and
then select type to "DATE".

End of the problem.

Is This Answer Correct ?    3 Yes 0 No

How do you validate Date by using which validation Control?..

Answer / cherran

Whereas in ASP.Net we can use RegularExpression Validator to
validate the date value. But in VB.NET we have to use Class
RegEx.

If Regex.IsMatch(txtDate,
"(0[1-9]|[12][0-9]|3[01])-(0[1-9]|1[012])-((19|20)\d\d)") Then

Is This Answer Correct ?    2 Yes 0 No

Post New Answer

More VB.NET Interview Questions

What are the two main parts of .net?

0 Answers  


Tell me which namespace are used for accessing the data?

0 Answers  


Explain option strict?

0 Answers  


how to create crystal reports in asp.net & vb.net with syntax

2 Answers  


how to connect crystal report with vb.net ?

6 Answers   Patni,


write a program to develop a graphic user interface application of marks book with students names and their names.the program should show the following options main menu,add student details,display student details,maximum mark and minimum mark.

0 Answers   College School Exams Tests,


1.wht is satellite assembly??? 2.How Garbage Collector works can u explain ????

3 Answers   ABC,


Explain the advantage of option strict on?

0 Answers  


Define clr?

0 Answers  


What is the significance of delegates. Where should they be used? What are the situations where we require them?

0 Answers  


What are the different types of applications supported in .net (or) .net framework?

0 Answers  


Is it necessary to have SQL server installed in your computer in order to create a service based database in vb.net?

0 Answers  


Categories