protected override void Initialize() { TagsGroup ag = TagsHelper.GetTagsGroup(); DetailGridView.DataSource = ag.Items; DetailGridView.DataBind(); }
string LoadTagDictionary() { string tagA = "<a href=\"javascript:addTag('{0}')\" title=\"为文章添加标签 {0}?\" >{0}</a> "; int maxCount = 20; StringBuilder sb = new StringBuilder(); TagsGroup ag = TagsHelper.GetTagsGroup(); int i = 1; foreach (TagsGroup.Item tag in ag.Items) { sb.AppendLine(string.Format(tagA, tag.Words)); if (i % 2 == 0) { sb.AppendLine("<br/>"); } if (i > maxCount) { break; } i++; } return(sb.ToString()); }
protected void QueryButton_Click(object sender, EventArgs e) { TagsGroup ag = TagsHelper.GetTagsGroup(); List <TagsGroup.Item> items = new List <TagsGroup.Item>(); foreach (TagsGroup.Item item in ag.Items) { if (item.Words.Contains(SearchTextBox.Text.Trim())) { items.Add(item); } } DetailGridView.DataSource = items; DetailGridView.DataBind(); // Initialize(); }