Rectangle 27 0

jquery Datepicker ASP.NET?


$("#<%= ImageButton1.ClientID %>").click(function(event) {
          $("#<%= txtFrom.ClientID %>").datepicker('show');
          event.preventDefault();
        });
$("#<%= ImageButton1.ClientID %>").click(function() {
          $("#<%= txtFrom.ClientID %>").datepicker('show');
          return false;
        });
$("#<%= ImageButton1.ClientID %>").click(function() {
          $("#<%= txtFrom.ClientID %>").datepicker('show');
        });
$("#txtStartDate").datepicker({
  showOn: "both",       
  onSelect: function(dateText, inst){
     $("#txtEndDate").datepicker("option","minDate",
     $("#txtStartDate").datepicker("getDate"));
  }
});
<asp:TextBox ID="txtFrom" MaxLength="10" runat="server" ToolTip="Enter From Date">
</asp:TextBox>
<asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/Images/clock_add.gif" />
<script type="text/javascript">
 $(function() {
        $("#<%= txtFrom.ClientID %>").datepicker({
            showmonth:true,
            autoSize: true,
            showAnim: 'slideDown',
            duration: 'fast'
        });

        $("#<%= ImageButton1.ClientID %>").click(function() {
          $("#<%= txtFrom.ClientID %>").datepicker('show');
        });
    });
</script>
return false

I have marked it and i again need to consult you what if i need two image buttons and two textboxes and in the first textbox the starting date goes and in the second textbox only the date after the date in textbox1 goes?

Thank you very much Shekhar, but the issue is as soon as i click on the image button the datepicker appears and suddenly disppears without even letting the date to be selected.

You are welcome. And don't forgot to mark it if it helped you.

Note
Rectangle 27 0

jquery Datepicker ASP.NET?


$("#<%= ImageButton1.ClientID %>").click(function(event) {
          $("#<%= txtFrom.ClientID %>").datepicker('show');
          event.preventDefault();
        });
$("#<%= ImageButton1.ClientID %>").click(function() {
          $("#<%= txtFrom.ClientID %>").datepicker('show');
          return false;
        });
$("#<%= ImageButton1.ClientID %>").click(function() {
          $("#<%= txtFrom.ClientID %>").datepicker('show');
        });
$("#txtStartDate").datepicker({
  showOn: "both",       
  onSelect: function(dateText, inst){
     $("#txtEndDate").datepicker("option","minDate",
     $("#txtStartDate").datepicker("getDate"));
  }
});
<asp:TextBox ID="txtFrom" MaxLength="10" runat="server" ToolTip="Enter From Date">
</asp:TextBox>
<asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/Images/clock_add.gif" />
<script type="text/javascript">
 $(function() {
        $("#<%= txtFrom.ClientID %>").datepicker({
            showmonth:true,
            autoSize: true,
            showAnim: 'slideDown',
            duration: 'fast'
        });

        $("#<%= ImageButton1.ClientID %>").click(function() {
          $("#<%= txtFrom.ClientID %>").datepicker('show');
        });
    });
</script>
return false

I have marked it and i again need to consult you what if i need two image buttons and two textboxes and in the first textbox the starting date goes and in the second textbox only the date after the date in textbox1 goes?

Thank you very much Shekhar, but the issue is as soon as i click on the image button the datepicker appears and suddenly disppears without even letting the date to be selected.

You are welcome. And don't forgot to mark it if it helped you.

Note