DateTime Validation
-
hi all, i have a TextBox control for DateTime input on the Page. i have multiple check on this DateTime control. Like... -Not Null -Valid DateTime -must be greater than some another DateTime -Others also in ASP.Net we have different Validation control to solve it. but i am using CustomValidater to check in one go. i am not understanding how to check DateTime whether it is a valid string or not. if anybody has idea please tell me... Except
**try-catch(FormatException)**
thanks in advance Confidence comes not from always being right, but from not fearing to be wrong..... Mihir.. -
hi all, i have a TextBox control for DateTime input on the Page. i have multiple check on this DateTime control. Like... -Not Null -Valid DateTime -must be greater than some another DateTime -Others also in ASP.Net we have different Validation control to solve it. but i am using CustomValidater to check in one go. i am not understanding how to check DateTime whether it is a valid string or not. if anybody has idea please tell me... Except
**try-catch(FormatException)**
thanks in advance Confidence comes not from always being right, but from not fearing to be wrong..... Mihir..I'm curious about why you don't choose the simple way of catching the FormatException. Anyway, there two methods that might give you a hint: + Use Reflector to have a look at the internal static
DateTimeParse.Parse
method. + Take a look at the client side functionValidatorCompare
in the WebUIValidation.js. -
hi all, i have a TextBox control for DateTime input on the Page. i have multiple check on this DateTime control. Like... -Not Null -Valid DateTime -must be greater than some another DateTime -Others also in ASP.Net we have different Validation control to solve it. but i am using CustomValidater to check in one go. i am not understanding how to check DateTime whether it is a valid string or not. if anybody has idea please tell me... Except
**try-catch(FormatException)**
thanks in advance Confidence comes not from always being right, but from not fearing to be wrong..... Mihir..