ASPForums.Net RSS Feedhttp://www.aspforums.net/Handlers/RSS.ashxLatest additions to the content that appears on ASPForums.Net(c) 2019 www.aspforums.com. All rights reserved.ASP.Net AJAX CalendarExtender Error: String was not recognized as a valid DateTime<p>Hi&nbsp;<a class="username" rel="Nandhu">Nandhu,</a></p> <p>Check this example. Now please take its reference and correct your code.</p> <p><strong><span style="text-decoration: underline;">HTML</span></strong></p> <pre class="brush: html">&lt;asp:ScriptManager runat=&#34;server&#34; /&gt; &lt;asp:TextBox ID=&#34;txt_attendance&#34; runat=&#34;server&#34; /&gt; &lt;asp:CalendarExtender ID=&#34;cal_ext_1&#34; TargetControlID=&#34;txt_attendance&#34; Format=&#34;dd/MMM/yyyy&#34; runat=&#34;server&#34;&gt; &lt;/asp:CalendarExtender&gt; &lt;asp:Button Text=&#34;Save&#34; runat=&#34;server&#34; OnClick=&#34;Save&#34; /&gt;</pre> <p><strong><span style="text-decoration: underline;">Code</span></strong></p> <p><strong>C#</strong></p> <pre class="brush: csharp">protected void Save(object sender, EventArgs e) { DateTime dt = DateTime.ParseExact(txt_attendance.Text, &#34;dd/MMM/yyyy&#34;, null); ClientScript.RegisterClientScriptBlock(this.GetType(), &#34;&#34;, &#34;alert(&#39;&#34; + dt + &#34;&#39;)&#34;, true); }</pre> <p><strong>VB.Net</strong></p> <pre class="brush: vb">Protected Sub Save(ByVal sender As Object, ByVal e As EventArgs) Dim dt As DateTime = DateTime.ParseExact(txt_attendance.Text, &#34;dd/MMM/yyyy&#34;, Nothing) ClientScript.RegisterClientScriptBlock(Me.GetType(), &#34;&#34;, &#34;alert(&#39;&#34; &amp; dt &amp; &#34;&#39;)&#34;, True) End Sub</pre> <p><strong><span style="text-decoration: underline;">Screenshot</span></strong></p> <p><strong><span style="text-decoration: underline;"><img src="https://i.imgur.com/MNLo7xz.gif" alt="" width="248" height="283" /></span></strong></p>https://www.aspforums.net:443/Threads/244820/ASPNet-AJAX-CalendarExtender-Error-String-was-not-recognized-as-a-valid-DateTime/https://www.aspforums.net:443/Threads/244820/ASPNet-AJAX-CalendarExtender-Error-String-was-not-recognized-as-a-valid-DateTime/Mon, 29 Apr 2019 01:45:23 GMT