如题

解决方案 »

  1.   

    see the documentation:http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwebuiwebcontrolscalendarclassdayrendertopic.asp
    <%@ Page Language="C#" AutoEventWireup="True" %>
    <html>
    <head>   <script language="C#" runat="server">
       
          void DayRender(Object source, DayRenderEventArgs e) 
          {         // Change the background color of the days in the month
             // to yellow.
             if (!e.Day.IsOtherMonth && !e.Day.IsWeekend)
                e.Cell.BackColor=System.Drawing.Color.Yellow;         // Add custom text to cell in the Calendar control.
             if (e.Day.Date.Day == 18)
                e.Cell.Controls.Add(new LiteralControl("<br>Holiday"));      }   </script>
     
       <form runat="server">      <h3>DayRender Event Example</h3>
     
          <asp:Calendar id="calendar1" 
                        OnDayRender="DayRender"
                        runat="server" ........>
          </asp:Calendar>
                       
       </form>
              
    </body>
    </html>
       
      

  2.   

    see the HoverCalendar example:Easily Adding Functionality to ASP.NET Server Controls 
    http://aspnet.4guysfromrolla.com/articles/100103-1.aspx