• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

asp.net calendar and style sheets

Torro

Member
I am making a web application and for part of it i would like to use the calendar provided with asp.net
dropped the calendar in, set up some style sheets for all the properties like day, selected day, weekend etc
started my web app and most of my styles dont show up
most notably, the text color for most of the cells
so i play around and look at the code being produced
it seems as if the day cells produce the following code:
<td class="calOtherMnth" align="Center" style="width:14%;"><a href="javascript:__doPostBack('cal1','1556')" style="color:Black">5</a></td>

as you can tell, it has the class "calOtherMnth" llike i want but then the anchor tag has a color style which overrides the stylesheet. How can i make the anchor tag not have this style?
i cant find any reference to it anywhere
thanks

 
I dont know how to get to the attribute
The anchor tag is rendered by the calendar control

edit: I've since found out that this is a design flaw in the calendar control
http://weblogs.asp.net/cazzu/archive/2004/02/02/66130.aspx
http://groups.google.com/groups?hl=...ev=/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&q=css+

the first link is an oop fix, creating a new "unstyled" calendar that is derived from the original calendar
the second is a stylesheet "fix" using !important (which doesnt work for some attributes for me... it works for background-color but not color?)

 
I've also managed to implement my own 'hack' to style the days within the calendar

***********
public void OnDayRender(Object sender, DayRenderEventArgs e)
{
CalendarDay day = e.Day;
string text = e.Day.DayNumberText;
DateTime now = e.Day.Date;
e.Cell.Style.Clear();

e.Cell.Controls.Clear();

DateTime newMill = new DateTime(2000, 1, 1);
string toAdd = "" + text + "";
e.Cell.Controls.Add(new LiteralControl(toAdd));
}
**************************
 
Back
Top