Menu

Want to work with us? We're on the lookout for digital experts.

We're hiring

Select Todays Date On CalendarExtender Asp.Net Ajax

Web Bureau


12 September 2013 by Web Bureau

Use the following script:

<script type="text/javascript">
function SelectToday(sender, e) {
var format = sender._todaysDateFormat;
var date = new Date();
var formateddate = date.format(format);
var daycells = $get(sender.get_id() + "_body").getElementsByTagName("DIV");
for (var i = 0; i < daycells.length; i++) {
if (daycells[i].title.indexOf(formateddate) > -1) {
daycells[i].style.backgroundColor = "Grey";
daycells[i].style.color = "White";
break;
}
}
}
</script>


Add the following to the calendar extender control: OnClientShown="SelectToday"

 

Grow your businessStart a project with us today.

This site uses essential cookies for parts of the site to operate and have already been set. Find out more about how we use cookies and how you may delete them. You may delete cookies, but parts of the site will not work.