public void RenderTags() { var topics = ForumDataProvider.GetTopicsByAllTags(TenantProvider.CurrentTenantID); var tags = new List <Tag>(); foreach (var top in topics) { top.Tags.ForEach(t => { if (tags.Find(_t => _t.ID == t.ID) == null) { tags.Add(t); } }); } tags.Sort((t1, t2) => Comparer <string> .Default.Compare(t1.Name, t2.Name)); StringBuilder sb = new StringBuilder(); if (tags.Count > 0) { foreach (var tag in tags) { sb.Append(TagInfo(tag, topics)); } } else { sb.Append("<b>" + Resources.ForumResource.SearchNotFoundMessage + "</b>"); } Response.Write(sb.ToString()); }