Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8034027
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T01:53:09+00:00 2026-06-05T01:53:09+00:00

I have a compare validator which validates on two <telerik:RadDatePicker> Start date and End

  • 0

I have a compare validator which validates on two <telerik:RadDatePicker> Start date and End date. The validation rule is simple, Check if Start Date is greater than the End Date and show the error message to the user to correct it

it works as expected but when the start and end dates are the same it is showing the message which is not expected. Code Below:

<asp:CompareValidator ID="dateCompareValidator" runat="server" ControlToValidate="endDate" ControlToCompare="startDate" Operator="GreaterThan" Type="Date" ErrorMessage="Start Date is greater than the End Date - please correct dates."Display="Dynamic"></asp:CompareValidator>

and the date pickers are as follows for both start date and end date:

<telerik:RadDatePicker CssClass="rcCalPopup" ID="endDate" runat="server" 
                                Skin="Vista">
                                <DateInput ID="DateInput2" runat="server" LabelCssClass="radLabelCss_Vista" Skin="Vista">
                                </DateInput>
                                <Calendar ShowRowHeaders="false" ID="Calendar2" runat="server" UseRowHeadersAsSelectors="False" UseColumnHeadersAsSelectors="False"
                                    ViewSelectorText="x" Skin="Vista">
                                </Calendar>
                                <DatePopupButton CssClass="rcCalPopup"></DatePopupButton>
                            </telerik:RadDatePicker>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T01:53:10+00:00Added an answer on June 5, 2026 at 1:53 am

    The rule you have defined with the Validator is:

    • Enddate must be greater than Startdate (note the missing equal)

    The validator Operator property determines the rule for valid input, not invalid input.

    So if you want to allow equal dates you have to use GreaterThanEqual

    <asp:CompareValidator ID="dateCompareValidator" runat="server" 
        ControlToValidate="endDate" ControlToCompare="startDate" 
        Operator="GreaterThanEqual" Type="Date" 
        ErrorMessage="End date must be equal or greater than start date - please correct dates."Display="Dynamic">
    </asp:CompareValidator>
    

    Note that i’ve also changed the ErrorMessage accordingly. If the input control is empty, no validation functions are called and validation succeeds. Use a RequiredFieldValidator control to require the user to enter data in the input control.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two dates: how do I compare which one is greater date in
I have to compare two strings for case insensitive equality which one is faster
I am using a compare validator, which validates that the entered number is a
I have a start date and end date field in a form. I have
HI i have custom validator which is to compare the value in 2 textboxes
I have a requirement by which need to check validation between number of days
I have two input fields fromDate and toDate which are instances of Date class.
I have this compare validator: <asp:CompareValidator ID=cpvBirthDate Type=Date ControlToValidate=txtBirthDate Operator=DataTypeCheck runat=server ErrorMessage=Please enter a
I have to compare 2 values which are the text property of 2 textbox
We are using a validation framework (something we have cooked up ourselves) which allows

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.