Set TodayDayStyle: background color and foreground color : Calendar « Asp Control « ASP.Net

ASP.Net
1. ADO.net Database
2. Ajax
3. Asp Control
4. Collections
5. Components
6. Data Binding
7. Development
8. File Directory
9. HTML Control
10. Language Basics
11. Login Security
12. Mobile Control
13. Network
14. Page
15. Request
16. Response
17. Server
18. Session Cookie
19. Sitemap
20. Theme Style
21. User Control and Master Page
22. Validation by Control
23. Validation by Function
24. WebPart
25. WPF
26. XML
Java
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
ASP.Net » Asp Control » Calendar 
Set TodayDayStyle: background color and foreground color


<%@ Page Language="C#" %>
<HTML>
  <body>
    <script runat="server">
    void PrettyCalendar_OnDayRender (object Sender, System.Web.UI.WebControls.DayRenderEventArgs e)
    {
      if (e.Day.Date == System.DateTime.Today)
      {
        e.Cell.Controls.Add(new LiteralControl("<br />"));

        e.Cell.Controls.Add(new LiteralControl("Today!"));      
      }
    }
    </script>
    <form runat="server" ID="Form1">
      <asp:Calendar ID="PrettyCalendar" 
                    Runat="server" 
                    OnDayRender="PrettyCalendar_OnDayRender">
        <TodayDayStyle ForeColor="Red" BackColor="Aqua"></TodayDayStyle>
        <DayStyle Font-Bold="True" 
                  HorizontalAlign="Left" 
                  Height="90px" 
                  BorderWidth="1px" 
                  BorderStyle="Solid" 
                  BorderColor="Red" 
                  Width="100px" 
                  VerticalAlign="Top" 
                  BackColor="Yellow"></DayStyle>
        <NextPrevStyle ForeColor="Blue"/>
        <DayHeaderStyle Font-Size="Large" Font-Bold="True" BorderWidth="1px" ForeColor="Brown" BorderStyle="Solid" BorderColor="Black" Width="100px" BackColor="#00C0C0"></DayHeaderStyle>
        <TitleStyle Font-Size="Large" Font-Bold="True" BorderWidth="1px" BorderStyle="Solid" BorderColor="Black" BackColor="#80FFFF"></TitleStyle>
        <WeekendDayStyle BackColor="#C0C0C0"></WeekendDayStyle>
      </asp:Calendar>
    </form>
  </body>
</HTML>

 
Related examples in the same category
1. Change Calendar selection based on data from the database (VB.net)
2. Calendar selected value changed event (VB.net)
3. Assign today's date to asp calendar (VB.net)
4. Set asp calendar border (VB.net)
5. Calendar Control: day name format, first day of week (VB.net)
6. Calendar Control: nextprevformat (VB.net)
7. Calendar Control: titleformat (VB.net)
8. Controlling the Appearance of Individual Cells of Dates (VB.net)
9. Calendar control: on day render (VB.net)
10. Formatting Date Sections in a Calendar Control (VB.net)
11. Date Selection event in a Calendar Control (VB.net)
12. Formatting the Header Styles in a Calendar Control (VB.net)
13. On visible month changed event for a calendar control (VB.net)
14. Setting Custom Previous and Next Month Text in the Calendar Control (VB.net)
15. Reading Selected Dates in a Date Range through the Calendar Control (VB.net)
16. Allowing the Selection of Multiple Dates in a Calendar Control (VB.net)
17. Displaying a Date in the Calendar Control (VB.net)
18. Displaying a Selected Range of Dates in the Calendar Control (VB.net)
19. Basic Calendar Control: show grid lines, show day header (VB.net)
20. On Date and Month Selection Changed (VB.net)
21. Select a week (VB.net)
22. Convert selected date from asp:Calendar to long string (VB.net)
23. Selected value change envent for asp:Calendar (VB.net)
24. Get selected date from asp:Calendar (VB.net)
25. Calendar with TodayDayStyle, SelectorStyle, NextPrevStyle, and SelectedDayStyle (C#)
26. Calendar control in code behind (C#)
27. Load event in calendar selection event (C#)
28. Define and use calendar in code behind (C#)
29. Embed Javascript to C# code to create a popup window
30. Popup calendar
31. Calendar events: render and change events
32. Visible month changed event
33. Day renderer
34. Calendar selection changed event
35. Calendar selection mode: DayWeekMonth
36. Calendar selection mode: Day
37. Calendar selection mode: DayWeek
38. Add control to Calendar cell
39. Set DayStyle, NextPrevStyle, DayHeaderStyle, TitleStyle, WeekendDayStyle
40. Change size of Calendar
41. Check the range of Calendar controls
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.