Formatting a Calendar using CSS

Last post 01-31-2004 11:38 PM by vga. 2 replies.

Sort Posts:

  • Formatting a Calendar using CSS

    01-12-2003, 7:38 PM
    • Member
      140 point Member
    • abacker
    • Member since 09-24-2002, 8:40 PM
    • Marin County, CA
    • Posts 28
    I am trying to format my calendar using css. I have an extensive list of styles that we use to keep things consistent throughout the site.

    I can not figure out any way to apply a CSS style to the day (or some other parts). Sure, I can apply it to the TD via cssClass but that doesn't help since the day is a link which overrides the <td>'s class.

    The day font (daystyle.font...) is just a fontInfo class, which does not appear to support CSS in any way, or even attributes so I could do something like dayStyle.Font.Attributes["class"] = "myClass".

    Is there any way around this?


    p.s. Does anyone know why this was left off, in this case and in general? It is so glaringly needed that it must have been done intentionally. Since any web dev. is going to try to use css straight off I can't believe this was not noticed in testing. Then again, maybe there is a reasonable reason to forbid css, but I can't think of any.
  • Re: Formatting a Calendar using CSS

    01-13-2003, 8:00 AM
    • Member
      297 point Member
    • keith5000
    • Member since 07-08-2002, 11:28 AM
    • Columbia, MD
    • Posts 62
    Try this:

    <asp:Calendar ... runat="server">

    <DayStyle CssClass="myClass" />

    ...

    </asp:Calendar>
  • Re: Formatting a Calendar using CSS

    01-31-2004, 11:38 PM
    • Member
      295 point Member
    • vga
    • Member since 06-17-2002, 5:38 PM
    • Posts 27
    • TrustedFriends-MVPs

    That won't work. Here[1] is why.


    [1] http://weblogs.asp.net/vga/archive/2004/02/01/CalendarsBuggyStyleHandling.aspx
    Victor Garcia Aprea
    Microsoft MVP | ASP.NET

    Looking for insights on ASP.NET?, read my blog: Followers of the IHttpHandler !!
Page 1 of 1 (3 items)