The below code is for validating a textbox for date of birth. The conditions are
- Textbox can't be empty
- Textbox date should be in format dd/mm/yyyy
- Textbox date should not be larger than current date. ie; no future date (to show error like -U r not born yet dude)
<asp:TextBox ID="txtDateOfBirth" runat="server" CausesValidation="True" />
(dd/mm/yyyy e.g. : 12/12/2011)
<asp:CustomValidator runat="server" ID="valDateRange" ControlToValidate="txtDateOfBirth" ErrorMessage="enter valid date" />
But the problem is that, the textbox is inside an ajax wrapper so only client side validations will work. Anybody here, Plz help me with any hints, suggestions or with working code!!. I will be very great-full because i was working on this since morning