You can change the look and feel of AJAX calendar control by overriding the default CSS classes. You can learn about default CSS classes of Calendar control in the last article: Ajax calendar extender CSS theme. Create your own CSS for calendar control using user defined name for the new CSS class that would be used to set the CssClass property of Calendar control.
You can customize the look and feel of calendar control similar to the following calendar figure:
Create a CSS stylesheet with name calendar.css and save to in the same directory having the asp.net web page in which you want to link it.
Copy and paste the following CSS code in calendar.css file.
CSS code:
.cal_Theme1 .ajax__calendar_container
{
}
.cal_Theme1 .ajax__calendar_header
.cal_Theme1 .ajax__calendar_title,
.cal_Theme1 .ajax__calendar_next,
.cal_Theme1 .ajax__calendar_prev
.cal_Theme1 .ajax__calendar_body
.cal_Theme1 .ajax__calendar_dayname
.cal_Theme1 .ajax__calendar_day
.cal_Theme1 .ajax__calendar_hover .ajax__calendar_day,
.cal_Theme1 .ajax__calendar_hover .ajax__calendar_month,
.cal_Theme1 .ajax__calendar_hover .ajax__calendar_year,
.cal_Theme1 .ajax__calendar_active
.cal_Theme1 .ajax__calendar_today
.cal_Theme1 .ajax__calendar_other,
.cal_Theme1 .ajax__calendar_hover .ajax__calendar_today,
.cal_Theme1 .ajax__calendar_hover .ajax__calendar_title
HTML code for AJAX Calendar Control ASP.Net web page
Note: CssClass Property of ajaxToolkit CalendarExtender is set as cal_Theme1. It will inherit the styles defined in the calendar.css file to change the look and feel of the calendar control.
Currently rated 5.0 by 1 people
Tags: asp.net 2.0, ajax, ajax control toolkit calendar extender, ajax calendar control css example, ajax calendar css, asp.net ajax control toolkit, download ajax control toolkit
8/23/2008 9:09:47 PM