Hi,
Following code explains how I'm using custom jQuery functions to enable only Sunday and Saturday respectively as AllowFrom and AllowTo
function AllowFrom(sender, args) {
$('div[id$="caltxtFrom_container"] div[class="ajax__calendar_day"]').each(function () {
var date = new Date();
date = $(this).attr('date');
if (date.getDay() != 0)
$(this).css('cursor', 'pointer').attr('disabled', 'disabled').css('text-decoration', 'line-through');
else
$(this).css('font-weight', 'bold');
});
}
function AllowTo(sender, args) {
$('div[id$="caltxtToDate_container"] div[class="ajax__calendar_day"]').each(function () {
var date = new Date();
date = $(this).attr('date');
if (date.getDay() == 6)
$(this).css('font-weight', 'bold');
else
$(this).css('cursor', 'pointer').attr('disabled', 'disabled').css('text-decoration', 'line-through');
});
}
and here are my calendar extender controls. Please note that I'm calling above function on OnClientShown.
<ajaxToolkit:CalendarExtender ID="caltxtFrom" runat="server" Format="MM/dd/yyyy"
OnClientShown="AllowFrom" PopupPosition="Right" TargetControlID="txtFromDate" />
<ajaxToolkit:CalendarExtender ID="caltxtToDate" runat="server" Format="MM/dd/yyyy"
OnClientShown="AllowTo" PopupPosition="Right" TargetControlID="txtToDate" />
</td>
jQuery functions mentioned above you can change to match your requirements
Hope that Helps,
Thanks