//HTML
<asp:TextBox runat="server" Width="105px" ID="TextBox1" ></asp:TextBox>
<asp:CalendarExtender ID="CalendarExtender1"
runat="server"
PopupButtonID="dt_From"
TargetControlID="dt_From"
Enabled="True"
Format="dd/MM/yyyy"
BehaviorID="startdate"</asp:CalendarExtender>
<asp:TextBox runat="server" Width="105px" ID="TextBox2" ></asp:TextBox>
<asp:CalendarExtender ID="CalendarExtender2" runat="server"
PopupButtonID="dt_To"
BehaviorID="enddate"
TargetControlID="dt_To"
Enabled="True"
Format="dd/MM/yyyy">
</asp:CalendarExtender>
//Script
<script>
function setdate() {
var dsd = new
Date(2014, 03, 01); //fixed date
//start date of calender
dsd.setDate(dsd.getDate() + 1); // add one day in fixed date
dsd.setDate(dsd.getDate() - 1); // subtract one day in fixed date
//end date of calender control
var ded = new
Date(2015, 02, 31);
ded.setDate(ded.getDate() + 1);
//CalendartxtBenFromb is behaviour id of
the calender control
$find("startdate").set_startDate(dsd);
$find("enddate").set_startDate(dsd);
return false;
}
</script>
//result
No comments:
Post a Comment