Trying to CSS it, I can CSS the cells, and the days of the week, and I think the top part that says the month, but the area around the month is silver, and no attempt at cssing it will change it - I tried all the different Css properties (I think) but it always ends up being silver. It appears in the designer as silver too. I can't find a way to change this...ideas?
The rendered HTML for the calendar control will probably contain an inline style definition by default e.g style="background-color: silver;"
, which will take precedence over CSS declarations unless they have the !important flag.
You could change this in the markup for the calendar control as a quick fix
<asp:Calendar id="cal1" runat="server">
<TitleStyle CssClass="classname" />
</asp:Calendar>
Try using IE Developer toolbar/Firebug + Firefox, and hover over the item that you want to change the color of. See if writing CSS for that items works.
Unfortunately, this style is actually hard-coded into the Render method of the original ASP.NET Calendar object. You can use Reflector to see this. Yes, it's ridiculous. Use an alternative calendar object, or sublclass the calendar and fix the Render method. Not sure if this is fixed in 3.5...
Just add this in the ASPX of your control:
TitleStyle-BackColor="Transparent"
That should solve the problem.
Marco - your a legend! That is the only thing I could get to work for me. You saved me a massive headache. THANKS! Gary