I m inserting date and the validat开发者_运维百科ion is it should not be before date than today.
I m using jquery datepicker.
You can do something like this
if (datePickerID.getTime() < date.getTime()) {
write your logic here
}
Use RangeValidator control. Set the ControlToValidate to your TextBox
control. Set the Type property to Date. And, set the MaximumValue to the current date...
Refer to Validation - RangeValidator
You can use the option minDate
, if you don't want user to be able select any date before a particular date.
$( ".selector" ).datepicker( "option", "minDate", new Date());
//Will set the minimum date that the user can select to Today.
Demo
精彩评论