Click here to Skip to main content
15,900,258 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
hi,

I am using asp.net 4.0. I have created a web user control for date validation. The date format which i am using is "dd-MMM-yyyy". This control has two textboxes and next to each textbox there is calender extender(Ajax control) and also i am using watermark extender for textboxes. So i want create control such that user either can not enter anything in textbox (Enabled="False") or if user enters date it should validate the date and if the dates are valid i have to compare dates.

When i am disabling textboxes to prevent user to enter text, i am getting textbox value as "null" in control. When i am allowing users to enter text i have to validate date. This problem i have solved some extent by using regular expression. But the main problem i am facing is comparing the two dates. I have used compare validator and i have used tried Jquery for this. When i am using compare validator, its comparing only days in date not whole date. And when i am using jquery, it is behaving different for diiferent browsers.

So please can anyone help me to solve this problem either with compare validator or Jquery.

Thanks in advance.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900