How to check date should not be greater than today date using compare field validator i:e Client side validation in asp .net
I have used this
controltovalidate="txtRegDate" type="Date" Operator="GreaterThan"
valuetocompare='<%= DateTime.Now.ToShortDateString() %>' />
Getting Error
The value '<%= DateTime.Now.ToShortDateString() %>' of the ValueToCompare property of 'Comparevalidator2' cannot be converted to type 'Date'.
4 Replies
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Manas MohapatraPosted Jan 28, 2016, 6:06 AM
Shubham KumarPosted Jan 28, 2016, 6:01 AM
Sameer KhanPosted Jan 28, 2016, 5:58 AM
Shubham KumarPosted Jan 28, 2016, 5:51 AM
.NET:
(In Page_Load method)