w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Date Picker Control Using AjaxControlToolkit in a form (Comparing between 2 date picker )

You need to handle client-side DateSelectionChanged event of the first extender and set up startDate property of the second extender:

<b>From</b>
<asp:TextBox ID="txtfrom" runat="server"></asp:TextBox>
<ajaxToolkit:CalendarExtender ID="ceLoanTakenDate" runat="server"
Format="dd/MM/yyyy" 
    PopupButtonID="txtfrom" TargetControlID="txtfrom" 
    OnClientDateSelectionChanged="ceLoanTakenDate_dateSelectionChanged">
</ajaxToolkit:CalendarExtender>
&nbsp;&nbsp;
<b>To</b>
<asp:TextBox ID="txtto" runat="server"></asp:TextBox>
<ajaxToolkit:CalendarExtender ID="CalendarExtender1" runat="server"
Format="dd/MM/yyyy" PopupButtonID="txtto"
    TargetControlID="txtto">
</ajaxToolkit:CalendarExtender>

<script type="text/javascript">
    function ceLoanTakenDate_dateSelectionChanged(sender, args) {
        $find("<%= CalendarExtender1.ClientID
%>").set_startDate(sender.get_selectedDate());
    }
</script>




© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.