我已经实现了以下代码:此函数未调用
我的 HTML 代码是:
<asp:CalendarExtender ID="CalendarExtender1" runat="server" Format="dd/MM/yy" PopupButtonID="ImageButton1" PopupPosition="BottomRight" Enabled="true" OnClientDateSelectionChanged="DisableWeekends" TargetControlID="txtStartDate">
onclientshown=`"DisableWeekends"
函数如下:
function DisableWeekends(sender, args) {
for (var i = 0; i < sender._days.all.length; i++) {
for (var j = 0; j < 6; j++) {
if (sender._days.all[i].id == "DisabledWeekendsCalendar" + j + "_5") {
sender._days.all[i].disabled = true;
sender._days.all[i].innerHTML =
"<div>" + sender._days.all[i].innerText + "</div>";
}
if (sender._days.all[i].id == "DisabledWeekendsCalendar" + j + "_6") {
sender._days.all[i].disabled = true;
sender._days.all[i].innerHTML =
"<div>" + sender._days.all[i].innerText + "</div>";
}
}
}
}