Asp.net源码专业站
首页->博客空间->SpaceBuilderV1.0RC免安装版源码(51aspx调测)>>BasicWebControls/Channel/News/SiteNewsThreadRepeaterList.cs>>源码在线查看
温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:SpaceBuilderV1.0RC免安装版源码(51aspx调测)
当前文件:文件类型 SpaceBuilderV10RC/BasicWebControls/Channel/News/SiteNewsThreadRepeaterList.cs[7K,2009-6-12 11:55:43]打开代码结构图
普通视图
		            
1//------------------------------------------------------------------------------ 2// <copyright company="Tunynet"> 3// Copyright (c) Tunynet Network Technology Co., Ltd. All rights reserved. 4// </copyright> 5//------------------------------------------------------------------------------ 6 7using System; 8using System.Collections.Generic; 9using System.Text; 10using SpaceBuilder.Controls.BaseClasses; 11using SpaceBuilder.Components; 12using System.Web.UI.HtmlControls; 13using SpaceBuilder.Controls.Utils; 14using System.Web.UI.WebControls; 15using SpaceBuilder.Clubs.Components; 16using SpaceBuilder.Utils; 17using SpaceBuilder.Controls; 18using TunyNet.Utils; 19using TunyNet.Data.Utils; 20using SpaceBuilder.Forums.Components; 21using SpaceBuilder.Posts.Components; 22 23namespace SpaceBuilder.Web.Controls 24{ 25 public class SiteNewsThreadRepeaterList : TemplatedWebControl 26 { 27 SBContext wlContext; 28 29 protected override void OnInit(EventArgs e) 30 { 31 if (SkinName == null) 32 ExternalSkinFileName = "News/Skin-NewsThreadRepeaterList.ascx"; 33 else 34 ExternalSkinFileName = SkinName; 35 36 wlContext = SBContext.Current; 37 38 base.OnInit(e); 39 } 40 41 protected override void OnLoad(EventArgs e) 42 { 43 base.OnLoad(e); 44 EnsureChildControls(); 45 46 if (this.Page.IsPostBack == false) 47 { 48 BindList(); 49 } 50 } 51 52 Child Controls 57 58 protected override void AttachChildControls() 59 { 60 repeater = FindControl("repeater") as Repeater; 61 if (repeater != null) 62 { 63 repeater.ItemDataBound += new RepeaterItemEventHandler(repeater_ItemDataBound); 64 } 65 } 66 67 void repeater_ItemDataBound(object sender, RepeaterItemEventArgs e) 68 { 69 if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) 70 { 71 Forum forum = e.Item.DataItem as Forum; 72 73 SiteNewsThreadRepeater threadRepeater = e.Item.FindControl("SiteNewsThreadRepeater") as SiteNewsThreadRepeater; 74 if (threadRepeater != null) 75 { 76 threadRepeater.ForumID = forum.SectionID; 77 if (string.IsNullOrEmpty(this.CategoryIDExculed) == false) 78 { 79 string[] cateExclued = this.CategoryIDExculed.Split(',',';',''); 80 for(int i=0;i<cateExclued.Length;i++) 81 { 82 if (cateExclued[i] == forum.SectionID.ToString()) 83 { 84 threadRepeater.Visible = false; 85 break; 86 } 87 } 88 } 89 } 90 } 91 } 92 93 94 protected override void OnPreRender(EventArgs e) 95 { 96 base.OnPreRender(e); 97 this.BindPagingInfo(); 98 } 99 100 private void BindPagingInfo() 101 { 102 103 } 104 105 private void BindList() 106 { 107 ForumQuery query = new ForumQuery(); 108 query.ClubID = 0; 109 query.ForumType = this.ForumType; 110 //query.ForumTypeExclude = this.ForumTypeExclude; 111 112 query.ActiveStatus = this.ActiveStatus; 113 query.OnlyTopLevel = this.OnlyTopLevel; 114 query.SortBy = this.SortBy; 115 116 forums = SpaceBuilder.Forums.Components.Forums.GetForumsByClubID(query); 117 118 if (forums.Count > 0) 119 { 120 repeater.DataSource = this.forums; 121 repeater.DataBind(); 122 } 123 else 124 { 125 repeater.DataSource = null; 126 repeater.DataBind(); 127 } 128 } 129 130 属性 252 } 253}
还没有找到您心仪的内容?请用.net源码大搜捕
代码片断 打包下载该项目完整源码:SpaceBuilderV1.0RC免安装版源码(51aspx调测)
51Aspx.com 版权所有 CopyRight © 2006-2010. 京ICP备06046876号 本站法律顾问:ITlaw-庄毅雄律师
返回顶部
客户服务:点击这里进行客户咨询 业务合作:点击这里洽谈业务合作 合作热线:010-68880146