<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; //三个变量分别是当前月,前一月,和下一个月 private int intCurrentMonth,intPreMonth,intNextMonth; //三个整型数组存放相对月份写有blog的日期 protected System.Web.UI.WebControls.Calendar Calendar1; //这个就是我们的日历控件了 |
private void Calendar1_PreRender(object sender, System.EventArgs e) { Thread threadCurrent = Thread.CurrentThread; CultureInfo ciNew = (CultureInfo)threadCurrent.CurrentCulture.Clone(); ciNew.DateTimeFormat.DayNames = new string[]{"日","一","二","三","四","五","六"}; ciNew.DateTimeFormat.FirstDayOfWeek = DayOfWeek.Sunday; threadCurrent.CurrentCulture = ciNew; } |
private void Calendar1_DayRender(object sender, System.Web.UI.WebControls.DayRenderEventArgs e) { //该控件在创建每一天时发生。 CalendarDay d = ((DayRenderEventArgs)e).Day; TableCell c = ((DayRenderEventArgs)e).Cell; } |
Word教程网 | Excel教程网 | Dreamweaver教程网 | Fireworks教程网 | PPT教程网 | FLASH教程网 | PS教程网 |
HTML教程网 | DIV CSS教程网 | FLASH AS教程网 | ACCESS教程网 | SQL SERVER教程网 | C语言教程网 | JAVASCRIPT教程网 |
ASP教程网 | ASP.NET教程网 | CorelDraw教程网 |