title: String was not recognised as a valid datetime
body: <p>in my asp.net c# application am using ajax calender extender for collecting datetime information.When i tried submit this page it shows that String was not recognised as a valid datetime.I tried different ways to convert,none works for me.</p>
  
  <pre><code>string date =Request.Form[ txtBookDate.UniqueID];
  
              DateTime yeer = Convert.ToDateTime(date);
  </code></pre>
  
  <blockquote>
    <p>String was not recognized as a valid DateTime.</p>
    
    <p>Description: An unhandled exception occurred during the execution of
    the current web request. Please review the stack trace for more
    information about the error and where it originated in the code. </p>
    
    <p>Exception Details: System.FormatException: String was not recognized
    as a valid DateTime.</p>
    
    <p>Source Error: </p>
    
    <p>Line 78:             string date =Request.Form[ txtBookDate.UniqueID];
    Line 79:  Line 80:             DateTime yeer =
    Convert.ToDateTime(date); Line 81:             DateTime Bookdate =
    Convert.ToDateTime(date.ToString()); Line 82:             int WedYear
    = Bookdate.Year;</p>
    
    <p>Source File: D:\Sample
    Project\AuditoriumNew\AuditoriumNew\Registration.aspx.cs    Line: 80 </p>
    
    <p>Stack Trace: </p>
    
    <p>[FormatException: String was not recognized as a valid DateTime.]<br>
    System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi,
    DateTimeStyles styles) +10404058    System.Convert.ToDateTime(String
    value) +83    AuditoriumNew.Index.txtRent_TextChanged(Object sender,
    EventArgs e) in D:\Sample
    Project\AuditoriumNew\AuditoriumNew\Registration.aspx.cs:80<br>
    System.Web.UI.WebControls.TextBox.OnTextChanged(EventArgs e) +116<br>
    System.Web.UI.WebControls.TextBox.RaisePostDataChangedEvent() +50<br>
    System.Web.UI.WebControls.TextBox.System.Web.UI.IPostBackDataHandler.RaisePostDataChangedEvent()
    +10    System.Web.UI.Page.RaiseChangedEvents() +132    System.Web.UI.Page.ProcessRequestMain(Boolean
    includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
    +1644</p>
    
    <p>Version Information: Microsoft .NET Framework Version:4.0.30319;
    ASP.NET Version:4.0.30319.17929</p>
  </blockquote>
  
  <p>SOurce Code for ajax Extender</p>
  
  <pre><code>&lt;asp:Label ID="bok" Text="Booking Date" runat="server"&gt;&lt;/asp:Label&gt;
                      &lt;asp:TextBox ID="txtBookDate" runat="server" ReadOnly="true"&gt;&lt;/asp:TextBox&gt;
                      &lt;asp:Image ID="calender" runat="server" ImageUrl="img/cals/calender.png" /&gt;
                      &lt;asp:CalendarExtender ID="BookingDate" TargetControlID="txtBookDate" PopupButtonID="calender"
                          runat="server" PopupPosition="TopRight" DaysModeTitleFormat="dd/MM/yyyy" 
                          TodaysDateFormat="dd/MM/yyyy"&gt;
                      &lt;/asp:CalendarExtender&gt;
  </code></pre>
  
  <p>Actual Code</p>
  
  <pre><code> protected void txtRent_TextChanged(object sender, EventArgs e)
          {
              float CentralAmnt;
              float renter;
  
              double rent = Convert.ToDouble(txtRent.Text);
              renter = float.Parse(rent.ToString());
  
  
              ///Calculate CTValue
              double CTValue = Convert.ToDouble(12.36 / 100);
              double CTax = CTValue;
              float CentralTax = float.Parse(CTax.ToString());
  
              CentralAmnt = renter * CentralTax;
  
  
              ///Calculate LT Value
  
              double LTax = 0.15;
              float LuxTax = float.Parse(LTax.ToString());
              float LuxAmnt = renter * LuxTax;
              string s = txtBookDate.Text;
              DateTime yeer;
  
               yeer = Convert.ToDateTime(s);
  
              //DateTime yeer = Convert.ToDateTime(s);
              DateTime Bookdate = Convert.ToDateTime(yeer.ToString());
              int WedYear = Bookdate.Year;
              if (WedYear &lt; 2014)
              {
                  float TotAmnt = renter + LuxAmnt;
  
                  txtTotal.Text = TotAmnt.ToString();
                  LuxuaryTaxAmnt = LuxAmnt;
  
  
              }
              else
              {
                  float TotAmnt = renter + CentralAmnt + LuxAmnt;
  
                  txtTotal.Text = TotAmnt.ToString();
                  LuxuaryTaxAmnt = LuxAmnt;
                  CentralTaxAmnt = CentralAmnt;
              }
          }
  </code></pre>