Simple processing of the blog calendar (log post day display link available)

Source: Internet
Author: User

This is my blog when the processing method, there is no real value *_+, here posted.

By the way, to help friends ...
http://community.csdn.net/Expert/topic/4716/4716187.xml?temp=.4245722

As follows:
private void Blogcal_prerender (object sender, System.EventArgs e)
... {
The day before the calendar is set up processing #region the week name before the calendar is established
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;
System.Globalization.CultureInfo Cinfo =
(System.Globalization.CultureInfo) System.Globalization.CultureInfo.CurrentCulture.Clone ();
CInfo.DateTimeFormat.DayNames =new string[]{"Monday", "Two", "three", "four", "five", "six", "Seven"};
System.Threading.Thread.CurrentThread.CurrentCulture = Cinfo;
#endregion
}

private void Blogcal_dayrender (object sender, System.Web.UI.WebControls.DayRenderEventArgs e)
... {
Handle days with log and style of calendar #region the style of days and calendars with log
The control occurs each day when it is created.
CalendarDay d = ((Dayrendereventargs) e). Day;
Common.js (D.date.month.tostring ());
Common.js (D.date.day.tostring ());
TableCell c = ((Dayrendereventargs) e). Cell;
Initializes an array of dates with blogs for the current month
if (intpremonth = 0)
... {
Intpremonth = D.date.month; Note: The first month we get when the Calendar control is initialized is not the current month, but the month of the first one months
Intcurrentmonth = intpremonth+1;
Common.js (Intcurrentmonth.tostring ());
if (intcurrentmonth>12)
intcurrentmonth=1;
Intnextmonth = intcurrentmonth+1;
if (Intnextmonth >12)
Intnextmonth = 1;
Arrpredays = Getarrayday (d.date.year,intpremonth); Get an array of dates with blogs for the first one months
Arrcurrentdays = Getarrayday (d.date.year,intcurrentmonth);//Get an array of dates with blogs for the month
Common.js (Arrcurrentdays.tostring ());
Arrnextdays = Getarrayday (d.date.year,intnextmonth);//Get an array of dates for next month's blog
}
int j=0;
if (D.date.month.equals (Intpremonth))
... {
while (! arrpredays[j]. Equals (0))
... {
if (D.date.day.equals (Arrpredays[j]))
... {
C.controls.clear ();
C.controls.add (New LiteralControl ("<a href= ' default.aspx?log_year=" +d.date.year+ "&log_month=" +d.) date.month+ "&log_day=" +d.date.day+ "' title= ' view the log published on that day ' ><font color= #C04000 > ' +d.date.day+ ' </font ></a> "));
C.controls.add (New LiteralControl ("<a href= '" +d.date.year+ "/" +d.date.month+ "/" +d.date.day+ "/' title= ') View the journal published on the Day ' ><font color= #C04000 > ' +d.date.day+ ' </font></a> '));
}
j + +;
}
}
else if (d.date.month.equals (Intcurrentmonth))
... {
while (! arrcurrentdays[j]. Equals (0

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.