title: System.FormatException: String was not recognized as a valid DateTime
body: <p>I am using AJAX calender extender with a textbox, And i want to disable past dates, so that user do not able to select those, which are less than today's date. My code is as follows<br></p>
  
  <p>In .aspx page</p>
  
  <pre><code>&lt;asp:TextBox ID="txtFromDate" runat="server" ontextchanged="txtFromDate_TextChanged"        AutoPostBack="true"&gt;&lt;/asp:TextBox&gt;
       &lt;asp:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="txtFromDate"&gt;
          &lt;/asp:CalendarExtender&gt;
          &lt;asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"&gt;
          &lt;/asp:ToolkitScriptManager&gt;
  </code></pre>
  
  <p>and on .cs page</p>
  
  <pre><code>protected void txtFromDate_TextChanged(object sender, EventArgs e)
      {
          DateTime dt1 = DateTime.Parse(txtFromDate.Text);
          if (dt1 &lt; DateTime.Now)
          {
              //Response.Write("you can not choose date earlier than today's date");
              txtFromDate.Text = null;
          } 
      }
  </code></pre>
  
  <p><br>But i am getting the following error:<br>
  <b> System.FormatException: String was not recognized as a valid DateTime</b>.
  <br> and is there any way that i can make those date unclickable so that user cant choose from them using startDate and Enddate attributes, or by some other means, I also tried those but again i got error that these are not supported. Any help will be appreciated.</p>