473,406 Members | 2,217 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

<asp:Calendar> & CSS

Hi,

Has anyone found a fix for the <asp:Calendar/ CSS bug whereby certain
attributes (mainly colours) are not rendered correctly?

E.g.

<asp:Calendar ID="calTest" runat="server"
OtherMonthDayStyle-CssClass="calOtherMonthDay" />

..calOtherMonthDay
{
font-size:xx-small;
color:Green;
}

The font-size attribute works, but the color attribute doesn't, no matter
what I set it to.

Hard-coding the style attributes in-line works, but I don't want to do that
in this instance because this particular site needs to change its style
depending on the currently logged-on user, and I'm achieving that through
stylesheets.

Does anyone know if there is an easy fix for this bug? The very last thing I
want to do is to interrogate the various styles in code-behind and apply
them in the DayRender event, but I'm thinking I don't think I have many
other options...

Any assistance gratefully received.

Mark
Aug 15 '06 #1
2 2650
Hi, Its worse than that, I've been trying to do the same so that I don't have
to go into every calendar if the colours change and found the follow shows
more inconcistancies :-

If anybody can see what is wrong or suggest a fix, I'd be glad too.

#### code starts

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Calendar Style Bugs ...</title>
<style type="text/css">
.cStyle
{
font-size:9pt;
background-color:white;
color:yellow;
}
.cDayHeader
{
background-color:red;
color:yellow;
}
.cNextPrev
{
background-color:blue;
color:yellow; /** BUG **/
}
.cOtherMonthDay
{
background-color:green;
color:yellow; /** BUG **/
}
.cSelectedDay
{
background-color:cyan; /** BUG **/
color:green; /** BUG **/
}
.cTitle
{
background-color:cyan;
color:yellow;
}
.cTodayDay
{
background-color:red;
color:white; /** BUG **/
}
.cWeekendDay
{
background-color:wheat;
color:red; /** BUG **/
}
.cDay
{
background-color:teal;
color:red; /** BUG **/
}
</style>
</head>

<body>
<form runat="server" action="calendarStyle.aspx">
<asp:Calendar ID="Calendar1" runat="server" Height="190px"
CssClass="cStyle"
NextPrevFormat="FullMonth" Width="250px" >
<DayHeaderStyle CssClass="cDayHeader" />
<NextPrevStyle CssClass="cNextPrev" />
<OtherMonthDayStyle CssClass="cOtherMonthDay" />
<SelectedDayStyle CssClass="cSelectedDay" />
<TitleStyle CssClass="cTitle" />
<TodayDayStyle CssClass="cTodayDay" />
<WeekendDayStyle CssClass="cWeekendDay" />
<DayStyle CssClass="cDay" />
</asp:Calendar>
</form>
</body>
</html>

#### code ends

Even using a style that works on one type on a another type ( ie using
cToday on cSelectedDay ) doesn't work, so have the gut feeling that either
the code to display both is wrong in .Net or that maybe something else is
overriding the style.

regards.
"Mark Rae" wrote:
Hi,

Has anyone found a fix for the <asp:Calendar/ CSS bug whereby certain
attributes (mainly colours) are not rendered correctly?

E.g.

<asp:Calendar ID="calTest" runat="server"
OtherMonthDayStyle-CssClass="calOtherMonthDay" />

..calOtherMonthDay
{
font-size:xx-small;
color:Green;
}

The font-size attribute works, but the color attribute doesn't, no matter
what I set it to.

Hard-coding the style attributes in-line works, but I don't want to do that
in this instance because this particular site needs to change its style
depending on the currently logged-on user, and I'm achieving that through
stylesheets.

Does anyone know if there is an easy fix for this bug? The very last thing I
want to do is to interrogate the various styles in code-behind and apply
them in the DayRender event, but I'm thinking I don't think I have many
other options...

Any assistance gratefully received.

Mark
Aug 18 '06 #2
"DevHead Kalibra" <De************@discussions.microsoft.comwrote in
message news:B1**********************************@microsof t.com...
Hi, Its worse than that, I've been trying to do the same so that I don't
have
to go into every calendar if the colours change and found the follow shows
more inconcistancies :-

If anybody can see what is wrong or suggest a fix, I'd be glad too.
I've given up on CSS for the <asp:Calendarcontrol and have had to
implement the workaround as I described. Was a question of time versus
payment, as always... :-)
Aug 18 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: vinu | last post by:
I have a javascript file named select.js. This is a file which is use to pop up a calendar, when clicked on a calendar icon in an ASP file. have a close button in the calendar. When i click on the...
44
by: Jim M | last post by:
I have had great success with using <iframe> with overflow-y set to auto. I can get a similar look with the <iframe> tag. BUT... In all cases I need to have fixed heights. Is there a way to...
2
by: js | last post by:
Any way to modify an <asp:Calendar> tag with parameters on the fly? Seems I'm not allowed to use the <% =xxx %> substitution for parameters to the <asp:Calendar> tag. Do I have to do code...
0
by: Mark Rae | last post by:
Hi, Is there any way to show the SelectedDay as, say, a red circle? Something like this: http://www.visualasp.com/vcdl/monthview/monthview_multiple_monthviews.asp N.B. I realise that the...
0
by: Tom Edelbrok | last post by:
I'm using VS 2005 to develop an intranet asp.net web application and I get a weird situation. If I start out with any ASPX page that contains an ImageButton control followed by a TextBox control,...
3
by: WB | last post by:
Hi, Is it poosible to build an appointment planner on a webform using asp:Calendar control? I would like to display one month at a time and show all the appointments scheduled in every day...
0
by: Mark Rae | last post by:
Hi all, Just canvassing people's opinions on the <asp:Calendar> control, specifically in v2. I'm interested to know: 1) Are you using it? If not, is that because you prefer a 3rd-party...
2
by: Sreenath Rao Nellutla | last post by:
Hai all, I am trying to create dropdown calendar control with HTML input control by writing JavaScript. But while executing I am getting the error as "Error on Page" on the status bar of the...
0
by: mathewgk80 | last post by:
HI all, I am having popup calendar Javascript code. But i dont know how it is connecting to asp.net code.. I am using asp.net,c#.net and also using 3tier architecture with master page.... I...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.