/// <summary> /// 绑定列表 /// </summary> protected void BindLinkList() { List <LinkInfo> list = LinkService.GetLinkList(); rptLink.DataSource = list; rptLink.DataBind(); }
/// <summary> /// 标签 /// </summary> public ActionResult Tag(string pagename) { var model = new PostListModel(); model.SiteName = SiteConfig.GetSetting().SiteName; model.ThemeName = "printV1"; model.PageTitle = SiteConfig.GetSetting().SiteName; model.SiteUrl = ConfigHelper.SiteUrl; model.MetaKeywords = SiteConfig.GetSetting().MetaKeywords; model.MetaDescription = SiteConfig.GetSetting().MetaDescription; model.SiteDescription = SiteConfig.GetSetting().SiteDescription; model.NavLinks = _linkService.GetLinkList((int)LinkPosition.Navigation, 1); model.RecentTags = _tagService.GetTagList(SiteConfig.GetSetting().SidebarTagCount); model.FooterHtml = SiteConfig.GetSetting().FooterHtml; model.GeneralLinks = _linkService.GetLinkList((int)LinkPosition.General, 1); TagInfo tag = _tagService.GetTagByPageName(pagename); if (tag != null) { int tagId = tag.TagId; model.MetaKeywords = tag.CateName; model.MetaDescription = tag.Description; model.PageTitle = tag.CateName; model.PostMessage = string.Format("<h2 class=\"post-message\">标签:{0}</h2>", tag.CateName); model.Url = ConfigHelper.SiteUrl + "tag/" + Jqpress.Framework.Utils.StringHelper.SqlEncode(pagename) + "/page/{0}"; const int pageSize = 10; int count = 0; int pageIndex = PressRequest.GetInt("page", 1); int cateid = PressRequest.GetQueryInt("cateid", -1); int tagid = PressRequest.GetQueryInt("tagid", -1); if (cateid > 0) { pageIndex = pageIndex + 1; } var postlist = _postService.GetPostPageList(pageSize, pageIndex, out count, cateid.ToString(), tagId, -1, -1, -1, -1, -1, "", "", ""); model.PageList.LoadPagedList(postlist); model.PostList = (List <PostInfo>)postlist; } model.IsDefault = 0; return(View("List", model)); }