protected string RenderBlogTags(BlogPost blogPost) { StringBuilder sb = new StringBuilder(); var tags = blogPost.ParsedTags; if (tags.Length > 0) { sb.Append(GetLocaleResourceString("Blog.Tags")); sb.Append(" "); for (int i = 0; i < tags.Length; i++) { string tag = tags[i].Trim(); string url = SEOHelper.GetBlogUrlForTag(tag); sb.Append(string.Format("<a href=\"{0}\">{1}</a>", url, Server.HtmlEncode(tag))); if (i != tags.Length - 1) { sb.Append(", "); } } } return(sb.ToString()); }
protected void rptrTagCloud_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item) { var blogPostTag = e.Item.DataItem as BlogPostTag; var hlLink = e.Item.FindControl("hlLink") as HyperLink; if (hlLink != null) { hlLink.NavigateUrl = SEOHelper.GetBlogUrlForTag(blogPostTag.Name); hlLink.Font.Size = new FontUnit(GetFontSize(blogPostTag.BlogPostCount), UnitType.Percentage); } } }