DayPilot - Open-Source Outlook-Like Calendar/Scheduling Control for ASP.NET
Schedule/Calendar Asp.NET controls with Source Code


Databound Schedule controls

Another Month Calendar
 (漂亮有源代码)

Have you ever resized an ASP.NET Calendar control?


Creating a Popup Date Picker (弹出日历)


The Calendar Control and the DayRender Event in ASP.Net
 

string lnkstr="";

              
for(int i=0;i<this.EntryCount;i++)

              
{

                   
if(entries[i].DateCreated.Date==e.Day.Date)

                   
{

                       lnkstr
=Regex.Replace(entries[i].TitleUrl,@"(/\d+\.aspx)$",".aspx",RegexOptions.IgnoreCase);

                       e.Cell.Text 
= "<a href=\"" +lnkstr+"\"><u>" + e.Day.Date.Day + "</u></a>";

                   }


 

              }


void Calendar1_DayRender(object sender, DayRenderEventArgs e) 
{
  CalendarDay d 
= ((DayRenderEventArgs)e).Day;
  CheckBox cb 
= new CheckBox();
  Label aLabel 
= new Label();
  
string sID = "chbx" + e.Day.Date.ToString("yyyyMMdd");
  cb.ID 
= sID;
  
if (Request.Form[sID] != null)
  holidays[e.Day.Date.Month,e.Day.Date.Day]
="Holiday";
  
if(d.IsWeekend)
  
{
  e.Cell.BackColor
=Color.SkyBlue;
  }

  
else
  
{
  DateTime theDate 
= e.Day.Date;
  
if (holidays[theDate.Month,theDate.Day] != null)
  
{
  e.Cell.BackColor
=Color.Yellow;
  aLabel.Text 
= "<br>" + holidays[theDate.Month,theDate.Day];
  e.Cell.Controls.Add(aLabel);
  }

  
else
  
{
  e.Cell.Controls.Add(cb);
  }

  }

  Session[
"Holiday"]=holidays;
}