473,658 Members | 2,628 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

<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"
OtherMonthDaySt yle-CssClass="calOt herMonthDay" />

..calOtherMonth Day
{
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 2658
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.dt d">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Calend ar 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="calenda rStyle.aspx">
<asp:Calendar ID="Calendar1" runat="server" Height="190px"
CssClass="cStyl e"
NextPrevFormat= "FullMonth" Width="250px" >
<DayHeaderSty le CssClass="cDayH eader" />
<NextPrevStyl e CssClass="cNext Prev" />
<OtherMonthDayS tyle CssClass="cOthe rMonthDay" />
<SelectedDaySty le CssClass="cSele ctedDay" />
<TitleStyle CssClass="cTitl e" />
<TodayDayStyl e CssClass="cToda yDay" />
<WeekendDayStyl e CssClass="cWeek endDay" />
<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"
OtherMonthDaySt yle-CssClass="calOt herMonthDay" />

..calOtherMonth Day
{
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.mi crosoft.comwrot e in
message news:B1******** *************** ***********@mic rosoft.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:Calendarco ntrol 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
2515
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 button, th calendar is not closing. here is the select.js file x999NS4compatible = (document.layers); var x999IE4compatible = (document.all); var x999dayabbs = ;
44
919
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 put either tag inside an HTML <TD> and have the same kind of scrolling effect. This would allow me to fill the screen and have the size of the scrolling box change on resize. Thanks in advance.
2
1616
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 behind procedures to intercept the creation of the Calendar to modify the parameters using DOM? Looking to generate multiple calendars, for different months, using a C# programming loop rather than in-line code in the .aspx file.
0
1084
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 above example is NOT using the <asp:Calendar> control - I'm merely using it as an example of the sort of formatting I'd like to use with an <asp:Calendar> control.
0
1820
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, everything works okay. I can press <ENTER> when the cursor is inside the text box and the page is running, and no events fire (this is what I expect). But as soon as I drop a second text box on the page (ie: after th first one) then pressing...
3
2914
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 (something like the Calendar in Microsoft Outlook)... Can this be done? Or do I have to build that from scratch?
0
986
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 control? 2) If you are using it, how are you using it? E.g. user control, popup
2
10718
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 browser. I wrote the following code in the HTML code for the web form: <%@ Page language="c#" Codebehind="WebForm2.aspx.cs" AutoEventWireup="false" Inherits="calendar.WebForm2" %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > <HTML>...
0
3323
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 would like to get the code for connecting the javascript to asp.net page... Please help me... The javascript code is as follows..
0
8427
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8746
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8523
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8626
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7355
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6178
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4175
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
1737
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.