App_Code.Controls.TagCloud.RenderControl C# (CSharp) Method

RenderControl() public method

Outputs server control content to a provided T:System.Web.UI.HtmlTextWriter object and stores tracing information about the control if tracing is enabled.
public RenderControl ( System.Web.UI.HtmlTextWriter writer ) : void
writer System.Web.UI.HtmlTextWriter The object that receives the control content.
return void
        public override void RenderControl(HtmlTextWriter writer)
        {
            if (this.WeightedList.Keys.Count == 0)
            {
                writer.Write("<p>{0}</p>", labels.none);
            }

            writer.Write("<ul id=\"tagcloud\" class=\"tagcloud\">");

            foreach (var key in this.WeightedList.Keys)
            {
                writer.Write("<li>");
                writer.Write(
                    string.Format(
                        Link,
                        string.Format("{0}?tag=/{1}", Utils.RelativeWebRoot, HttpUtility.UrlEncode(key)),
                        this.WeightedList[key],
                        string.Format("Tag: {0}", key),
                        key));
                writer.Write("</li>");
            }

            writer.Write("</ul>");
            writer.Write(Environment.NewLine);
        }