This is a migrated thread and some comments may be shown as answers.

Error validating datetimepicker

3 Answers 68 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
andieje
Top achievements
Rank 1
andieje asked on 07 Jun 2009, 10:50 PM
Hi

I am using 2 datetimepickers and a control validator to make sure the end date of something is after the start date but it is not working. I am receiving the error message of the validator no matter what I put in the end date. Please can you tell me what I am doing wrong.

Many thanks

 

<tr>

 

 

<td>Start date</td>

 

 

<td>

 

 

<telerik:RadDateTimePicker ID="dpStartTime" runat="server">

 

 

</telerik:RadDateTimePicker>

 

 

<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="dpStartTime"

 

 

ErrorMessage="RequiredFieldValidator">Start date required</asp:RequiredFieldValidator>

 

 

</td>

 

 

</tr>

 

 

<tr>

 

 

<td>End Time</td>

 

 

<td>

 

 

<telerik:RadDateTimePicker ID="dpEndTime" runat="server">

 

 

</telerik:RadDateTimePicker>

 

 

<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="dpEndTime"

 

 

ErrorMessage="RequiredFieldValidator">End date required</asp:RequiredFieldValidator></td>

 

 

</tr>

 

 

<tr>

 

 

<td>

 

 

<asp:CompareValidator ID="dateCompareValidator" runat="server" ControlToValidate="dpEndTime"

 

ControlToCompare

 

="dpStartTime" Operator="GreaterThan" Type="Date" ErrorMessage="The end date must be after the start date."></asp:CompareValidator>

 

 

</td>

 

 

<td>

 

 

</td>

 

 

</tr>

 

3 Answers, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 08 Jun 2009, 04:15 PM
Hello Andrea,

The RadDatePicker, RadTimePicker, and RadDateTimePicker controls can work seamlessly with standard ASP.NET validation controls.
For more information about how to achieve the desired functionality, please refer to the following articles:
Validation
Web Pages Validation

Regards,

Pavlina
the Telerik team

 


Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
andieje
Top achievements
Rank 1
answered on 08 Jun 2009, 11:18 PM
Hello

I have already looked at the examples in the demos and the documentation. In fact I took the validator within my code from one of your demos. However my code is not working and I cannot see why. I was hoping you might look at it and see if you can identify the error.

thanks
0
andieje
Top achievements
Rank 1
answered on 08 Jun 2009, 11:22 PM
I found the error
Tags
Calendar
Asked by
andieje
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
andieje
Top achievements
Rank 1
Share this question
or