/// <summary> /// 增加页面标题 /// </summary> protected override void AddHeaderTitle() { Entity.NativeWeb.News news = webFacade.GetNewsByNewsID(XID, 0); if (news != null) { AddMetaTitle(news.Subject + " - " + ApplicationSettings.Get("title")); } AddMetaKeywords(ApplicationSettings.Get("keywords")); AddMetaDescription(ApplicationSettings.Get("description")); }
/// <summary> /// 页面加载 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Entity.NativeWeb.News news = webFacade.GetNewsByNewsID(XID, 0); if (news != null) { source = news.IsLinks == 1 ? news.LinkUrl : ApplicationSettings.Get("title"); type = news.ClassID == 1 ? "新闻" : "公告"; issueDate = news.IssueDate.ToString("yyyy-MM-dd HH:mm:ss"); title = news.Subject; content = news.Body; Entity.NativeWeb.News news1 = webFacade.GetNewsByNewsID(XID, 1); if (news1 != null) { this.next1.Title = "上一篇新闻:" + news1.Subject; this.next1.HRef = "NewsView.aspx?XID=" + news1.NewsID; this.next2.Title = "上一篇新闻:" + news1.Subject; this.next2.HRef = "NewsView.aspx?XID=" + news1.NewsID; } else { this.next1.Title = "已经是第一篇了!"; this.next1.Disabled = true; this.next1.Visible = false; this.next2.Title = "已经是第一篇了!"; this.next2.Disabled = true; this.next2.Visible = false; } Entity.NativeWeb.News news2 = webFacade.GetNewsByNewsID(XID, 2); if (news2 != null) { this.last1.Title = "下一篇新闻:" + news2.Subject; this.last1.HRef = "NewsView.aspx?XID=" + news2.NewsID; this.last2.Title = "下一篇新闻:" + news2.Subject; this.last2.HRef = "NewsView.aspx?XID=" + news2.NewsID; } else { this.last1.Title = "已经是最后一篇了!"; this.last1.Disabled = true; this.last1.Visible = false; this.last2.Title = "已经是最后一篇了!"; this.last2.Disabled = true; this.last2.Visible = false; } } } Themes.Standard.Common_Header sHeader = (Themes.Standard.Common_Header) this.FindControl("sHeader"); sHeader.title = "新闻公告"; }
/// <summary> /// 页面加载 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Entity.NativeWeb.News news = FacadeManage.aideNativeWebFacade.GetNewsByNewsID(IntParam, 0); if (news != null) { source = news.IsLinks == 1 ? news.LinkUrl : ApplicationSettings.Get("title"); type = news.ClassID == 1 ? "新闻" : "公告"; issueDate = news.IssueDate.ToString("yyyy-MM-dd HH:mm:ss"); title = news.Subject; content = Utility.HtmlDecode(news.Body); Entity.NativeWeb.News news1 = FacadeManage.aideNativeWebFacade.GetNewsByNewsID(IntParam, 1); if (news1 != null) { this.next1.Title = "上一篇新闻:" + news1.Subject; this.next1.HRef = "NewsView.aspx?param=" + news1.NewsID; } else { this.next1.Title = "已经是第一篇了!"; this.next1.Disabled = true; this.next1.Attributes.Add("class", "ui-news-text-prev ui-no-page"); } Entity.NativeWeb.News news2 = FacadeManage.aideNativeWebFacade.GetNewsByNewsID(IntParam, 2); if (news2 != null) { this.last1.Title = "下一篇新闻:" + news2.Subject; this.last1.HRef = "NewsView.aspx?param=" + news2.NewsID; } else { this.last1.Title = "已经是最后一篇了!"; this.last1.Disabled = true; this.last1.Attributes.Add("class", "ui-news-text-next ui-no-page"); } } } }