" + Resources.labels.none + "
"; HtmlGenericControl ul = new HtmlGenericControl("ul"); ul.Attributes.Add("id", "monthList"); HtmlGenericControl year = null; HtmlGenericControl list = null; int current = 0; foreach (DateTime date in months.Keys) { if (current == 0) current = date.Year; if (date.Year > current || ul.Controls.Count == 0) { list = new HtmlGenericControl("ul"); list.ID = "year" + date.Year.ToString(); year = new HtmlGenericControl("li"); year.Attributes.Add("class", "year"); year.Attributes.Add("onclick", "BlogEngine.toggleMonth('year" + date.Year + "')"); year.InnerHtml = date.Year.ToString(); year.Controls.Add(list); if (date.Year == DateTime.Now.Year) list.Attributes.Add("class", "open"); ul.Controls.AddAt(0, year); } HtmlGenericControl li = new HtmlGenericControl("li"); HtmlAnchor anc = new HtmlAnchor(); anc.HRef = Utils.RelativeWebRoot + date.Year + "/" + date.ToString("MM") + "/default" + BlogSettings.Instance.FileExtension; anc.InnerHtml = DateTime.Parse(date.Year + "-" + date.Month + "-01").ToString("MMMM") + " (" + months[date] + ")"; li.Controls.Add(anc); list.Controls.AddAt(0, li); current = date.Year; } System.IO.StringWriter sw = new System.IO.StringWriter(); ul.RenderControl(new HtmlTextWriter(sw)); return sw.ToString(); } private SortedDictionary