title: DateTime.Parse or Convert.ToDateTime is not working
body: <p>I have a textbox with a calendar extender.</p>
  
  <p>The format should be like this:</p>
  
  <pre><code>&lt;add key="DateFormat" value="dd/MM/yyyy"/&gt;
  </code></pre>
  
  <p>I have the following on my aspx markup</p>
  
  <pre><code>  &lt;asp:TextBox ID="txt" runat="server" 
                          meta:resourcekey="txt" MaxLength="150" HtmlEncode="False"&gt;&lt;/asp:TextBox&gt;
                          &lt;ajaxToolkit:CalendarExtender runat="server"
                              TargetControlID="txt"
                                              PopupButtonID="Image1" Format="&lt;%$Appsettings:DateFormat%&gt;" /&gt;
  </code></pre>
  
  <p>WHen I try to use it in a property like this:</p>
  
  <pre><code>datett= DateTime.Parse(txt.Text),
  </code></pre>
  
  <p>It says FormatException.</p>
  
  <p>I debugged and also tried Convert.ToDatetime, same exception raised.</p>
  
  <p>The text I am testing is 30/05/2015</p>
  
  <p>which according to my format in my web.config should work fine.</p>
  
  <p><strong>update1</strong>
  I use the following code to change the language and culture of my page based on user selection, maybe this is why its failing, </p>
  
  <p>I see many answers, the 2nd question would be, how to get the current culture?</p>
  
  <pre><code>/// &lt;summary&gt;
          /// Handles the AcquireRequestState event of the Application control.
          /// &lt;/summary&gt;
          /// &lt;param name="sender"&gt;The source of the event.&lt;/param&gt;
          /// &lt;param name="e"&gt;The &lt;see cref="System.EventArgs"/&gt; instance containing the event data.&lt;/param&gt;
          protected void Application_AcquireRequestState(object sender, EventArgs e)
          {
              //Create culture info object 
              /*var ci = new CultureInfo(Session["Language"].ToString());
              System.Threading.Thread.CurrentThread.CurrentUICulture = ci;
              System.Threading.Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(ci.Name);*/
  
              System.Web.UI.Page p = (System.Web.HttpContext.Current.Handler as System.Web.UI.Page);
              if (p != null)
              {
                  p.UICulture = p.Culture = new CultureInfo((string)Session["Language"]).Name;
              }
          }
  </code></pre>