www.webdeveloper.com
Results 1 to 2 of 2

Thread: Problem with ASP.NET calendar component

  1. #1
    Join Date
    Jun 2004
    Posts
    390

    Angry Problem with ASP.NET calendar component

    I'm attmepting to style the background color of the "SelectedDayStyle" attribute of the calendar component with CSS. But no matter what I do, the background color always appears as gray. My code snippets are shown below:

    ASP:
    Code:
    <asp:Calendar ID="myCalendar" OnSelectionChanged="displayDates" OnLoad="displayDates" Runat="server" CssClass="calendar" NextMonthText=">>" PrevMonthText="<<">
        <TodayDayStyle CssClass="today" />
        <DayStyle CssClass="day" />
        <OtherMonthDayStyle CssClass="otherMonth_day" />
        <TitleStyle CssClass="title" />
        <NextPrevStyle CssClass="changeMonth" ForeColor="white" />
        <SelectedDayStyle CssClass="selectedDay" />
    </asp:Calendar>
    CSS:
    Code:
    .selectedDay
    {
    	background-color: #000000;
    	background: #000000;
    }
    All my other elements are styled just fine in CSS. Has anyone else tried setting the background color of the SelectedDayStyle via an external CSS file?

  2. #2
    Join Date
    Jun 2004
    Posts
    390
    Upon further research, I have concluded that the calendar compnent is not fully CSS customizable as mentioned here. Even though you can set a CssClass property of each paramater in the calendar object, some default styles will overright your class.

    In short, I would not recommend this component... thanks Microsoft.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles