<asp:calendar id="Calendar1" CellPadding="2" Width="160px" TitleStyle-BackColor="#000000" BorderColor="#aaaaaa" DayHeaderStyle-BackColor="#5e715e" OtherMonthDayStyle-ForeColor="#cccccc" DayNameFormat="Full" runat="server" TitleStyle-ForeColor="#ffffff" NextPrevStyle-ForeColor="#ffffff" CellSpacing="1" WeekendDayStyle-BackColor="#eeeeee" DayHeaderStyle-ForeColor="#ffffff" SelectionMode="None" TodayDayStyle-BorderColor="#5e715e" TodayDayStyle-BorderWidth="1" TodayDayStyle-Font-Bold="true" TodayDayStyle-ForeColor="#5e715e" > |
private int[] arrCurrentDays, arrPreDays, arrNextDays; //The three variables are the current month, the previous month, and the next month. private int intCurrentMonth,intPreMonth,intNextMonth; //Three integer arrays store the relative month dates with blogs written on them protected System.Web.UI.WebControls.Calendar Calendar1; //This is our calendar control |
private void Calendar1_PreRender(object sender, System.EventArgs e) { Thread threadCurrent = Thread.CurrentThread; CultureInfo ciNew = (CultureInfo)threadCurrent.CurrentCulture.Clone(); ciNew.DateTimeFormat.DayNames = new string[]{"Day","One","Two","Three","Four","Five","Six"}; ciNew.DateTimeFormat.FirstDayOfWeek = DayOfWeek.Sunday; threadCurrent.CurrentCulture = ciNew; } |
private void Calendar1_DayRender(object sender, System.Web.UI.WebControls.DayRenderEventArgs e) { //This control occurs every day when it is created. CalendarDay d = ((DayRenderEventArgs)e).Day; TableCell c = ((DayRenderEventArgs)e).Cell; } |