title: Using the CompareValidator control to compare user input date with today's date
body: <p>hey..i would like to compare the current date with the date entered by user..however, i'm encountering errors so far.. </p>
  
  <p>i tried something like this:</p>
  
  <pre><code>&lt;asp:TextBox id="txtDate1" runat="server" /&gt;    
  &lt;asp:CompareValidator runat="server" ErrorMessage="The date must be greater than today"
      ControlToValidate="txtDate1" type="date" 
      ValuetoCompare="DateTime.Today.ToShortDateString()" /&gt;
  </code></pre>
  
  <p>and i got an error stating that the value of <code>DateTime.Today.ToShortDateString()</code> of the <code>ValueToCompare</code> property of "" cannot be converted to type 'date' 
  i also tried <code>ValueToCompare="DateTime.Now.Date()"</code> and i got the same error message.</p>
  
  <p>please help me and i greatly appreciate it. </p>