title: Compare Validator for date validation
body: <p>The following is the code I'm using to select a date in asp.net </p>
  
  <p>I'm using a text box to display the date and image to show the calender icon, and Ajax calender extender to select the date in the format <code>dd-mmm-yyyy</code>.</p>
  
  <pre><code>&lt;asp:TextBox ID="txtReqCompDate" runat="server"
      ToolTip="Select Analysis Required Date" CssClass="formtext"
      CausesValidation="True"&gt;
  &lt;/asp:TextBox&gt;
  &lt;asp:ImageButton ID="ibReqCompletionDate" runat="server"
      ImageUrl="~/Images/Calendar.png" ImageAlign="AbsBottom" Height="15px" /&gt;
  &lt;asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server"
      ControlToValidate="txtReqCompDate" Display="Dynamic" Text="Required"
      ErrorMessage="Analysis Required Date" ValidationGroup="valProjForm"
      SetFocusOnError="True" Font-Size="Smaller"&gt;
  &lt;/asp:RequiredFieldValidator&gt;
  &lt;asp:CompareValidator runat="server" ID="cmp1"
      ErrorMessage="The date must be greater than todays date"
      ControlToValidate="txtReqCompDate" Type="Date" Operator="GreaterThan" /&gt;
  &lt;cc1:CalendarExtender ID="CalendarExtender1" runat="server"
      PopupButtonID="ibReqCompletionDate"
      TargetControlID="txtReqCompDate" Format="dd-MMM-yyyy" Enabled="True"&gt;
  &lt;/cc1:CalendarExtender&gt;
  </code></pre>
  
  <p>Even If I use this line in page load there is no use.</p>
  
  <pre><code>cmp1.ValueToCompare = DateTime.Now.ToShortDateString();
  </code></pre>
  
  <p>Please suggest me a way to display a message right away when some one selects a date less than today's date using comparevalidator.</p>
  
  <p>I need a similar functionality in several pages of my website. And also in the same page to select a date greater than txtReqCompDate.</p>
  
  <p>Or please suggest me a way to disable the previous dates in ajax calenderextender and show the date ahead of the current date in Ajax extender without affecting my current code functionality as I'm coding in .net 2.0.</p>
  
  <p>My Main issue here, it shows validation, if date is less than today's date and even when the date is greater than current date. Shows error message always whatever validator I use, compare or range</p>