Asp.net源码专业站
首页->博客空间->SpaceBuilder v1.0正式版源码>>BasicWebControls/Channel/News/NewsShow.cs>>源码在线查看
温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:SpaceBuilder v1.0正式版源码
当前文件:文件类型 SpaceBuiderV10Source/BasicWebControls/Channel/News/NewsShow.cs[2K,2009-6-12 11:55:07]打开代码结构图
普通视图
		            
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; 21 22namespace SpaceBuilder.Web.Controls 23{ 24 public class NewsShow : TemplatedWebControl 25 { 26 SBContext wlContext; 27 28 protected override void OnInit(EventArgs e) 29 { 30 if (SkinName == null) 31 ExternalSkinFileName = "News/Skin-NewsShow.ascx"; 32 else 33 ExternalSkinFileName = SkinName; 34 35 wlContext = SBContext.Current; 36 37 base.OnInit(e); 38 } 39 40 protected override void OnLoad(EventArgs e) 41 { 42 base.OnLoad(e); 43 EnsureChildControls(); 44 45 46 if (this.Page.IsPostBack == false) 47 { 48 this.BindData(); 49 } 50 } 51 52 Child Controls 58 59 protected override void AttachChildControls() 60 { 61 subject = FindControl("Subject") as Literal; 62 body = FindControl("Body") as Literal; 63 pubDate = FindControl("PubDate") as Literal; 64 } 65 66 void BindData() 67 { 68 Forums.Components.ForumPost entity = ForumPosts.GetPost(this.NewsID); 69 if (entity != null) 70 { 71 Header.AddTitle(string.Format("{1}{0}{2}{0}{3}", wlContext.BrowserTitleSeparator, entity.Subject, "站点资讯", wlContext.SiteName), Context); 72 subject.Text = entity.Subject; 73 body.Text = entity.Body; 74 pubDate.Text = Formatter.FormatDate(entity.PostDate); 75 } 76 } 77 78 属性 94 95 } 96}
还没有找到您心仪的内容?请用.net源码大搜捕
代码片断 打包下载该项目完整源码:SpaceBuilder v1.0正式版源码
51Aspx.com 版权所有 CopyRight © 2006-2010. 京ICP备06046876号 本站法律顾问:ITlaw-庄毅雄律师
返回顶部
客户服务:点击这里进行客户咨询 业务合作:点击这里洽谈业务合作 合作热线:010-68880146