title: Date validation with ASP.NET validator
body: <p>I'm trying to use an ASP.NET <code>RangeValidator</code> to validate a date on a textbox. The format of the date entered on the textbox is <code>dd MMMM yyyy</code>.</p>
  
  <p>How can I use the range validator to validate a valid date? If I enter <strong>1 January 1000</strong> as the min or max value I get an error saying value cannot be converted to type date, but if I use another format it picks up my entered text as invalid.</p>
  
  <p>Below is my code:</p>
  
  <pre><code>&lt;asp:TextBox 
      runat="server" 
      ID="txtDatecompleted" 
  /&gt;
  &lt;cc2:CalendarExtender
      ID="datecompletedExtender" 
      runat="server"
      TargetControlID="txtDatecompleted"
      Format="dd MMMM yyyy"
  /&gt;  
  &lt;asp:RangeValidator 
      runat="server" 
      ID="RangeValidator1" 
      Type="Date" 
      ControlToValidate="txtDatecompleted" 
      MaximumValue="9999/12/28" 
      MinimumValue="1000/12/28" 
      ErrorMessage="enter valid date" 
      Display="None"
  /&gt;
  &lt;cc2:ValidatorCalloutExtender 
      ID="RangeValidator1_ValidatorCalloutExtender" 
      runat="server"
      Enabled="True"
      TargetControlID="RangeValidator1"&gt;
  &lt;/cc2:ValidatorCalloutExtender&gt;
  </code></pre>