title: Date Picker Control Using AjaxControlToolkit in a form (Comparing between 2 date picker )
body: <p>I am using the normal <strong>AjaxControlToolkit</strong> &amp; use 2 datepicker in my page.</p>
  
  <p><strong>First date picker is taking the date which doesn't ex id from Today Date(today or any previous date). On the 2nd text box I can selected the date in between the date taken in the 1st date picker to Today Date.</strong></p>
  
  <p>The Script code which i am using that works on the JQuery date picker. But it won't work in the normal Ajax date picker.</p>
  
  <p>Here is the code As follows:</p>
  
  <pre><code>&lt;%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %&gt;
  
  &lt;%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %&gt;
  
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head runat="server"&gt;
  &lt;title&gt;Date Picker&lt;/title&gt;
  
  &lt;script type="text/C#" &gt;
  
  $(function () {
      $("#txtfrom").datepicker({
          onSelect: function (date) {
              $("#txtto").datepicker({
                  minDate: date,
                  maxDate: new Date()
              });
          },
          maxDate: 0
      });
  
  }); 
  
  
  &lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  &lt;form id="form1" runat="server"&gt;
  &lt;asp:ScriptManager ID="ScriptManager1" runat="server"&gt;
  &lt;/asp:ScriptManager&gt;
  &lt;div&gt;
  &lt;b&gt;From&lt;/b&gt;
  &lt;asp:TextBox ID="txtfrom" runat="server"&gt;&lt;/asp:TextBox&gt;
  &lt;cc1:CalendarExtender ID="ceLoanTakenDate" runat="server" Format="dd/MM/yyyy"     PopupButtonID="txtfrom" TargetControlID="txtfrom"&gt;
      &lt;/cc1:CalendarExtender&gt;
      &amp;nbsp &amp;nbsp
      &lt;b&gt;To&lt;/b&gt;
      &lt;asp:TextBox ID="txtto" runat="server"&gt;&lt;/asp:TextBox&gt;
  &lt;cc1:CalendarExtender ID="CalendarExtender1" runat="server" Format="dd/MM/yyyy" PopupButtonID="txtto"  TargetControlID="txtto"&gt;
      &lt;/cc1:CalendarExtender&gt;
  
  
  &lt;/div&gt;
  &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>