public override void OnInitTemplateInfo(EventArgs e) { string sourceName = BasePage.RequestString("copyfrom"); if (!Source.ExistsPassedSource(sourceName)) { TemplatePage.WriteErrMsg("指定的来源不存在!"); } string dynamicConfigTemplatePath = TemplatePage.GetDynamicConfigTemplatePath(Path.GetFileNameWithoutExtension(this.Page.Request.FilePath)); NameValueCollection values = new NameValueCollection(); values.Add("copyfrom", DataSecurity.FilterBadChar(sourceName)); if (!string.IsNullOrEmpty(dynamicConfigTemplatePath)) { TemplateInfo info = new TemplateInfo(); info.QueryList = values; info.PageName = TemplatePage.RebuildPageName(base.Request.Url.LocalPath, base.Request.QueryString); info.TemplateContent = Template.GetTemplateContent(dynamicConfigTemplatePath); info.RootPath = HttpContext.Current.Request.PhysicalApplicationPath; info.CurrentPage = DataConverter.CLng(base.Request.QueryString["page"], 1); info.PageType = 1; base.TemplateInfo = info; } else { TemplatePage.WriteErrMsg("您查看的来源未设置模板!", SiteConfig.SiteInfo.VirtualPath + "Default.aspx"); } }
/// <summary> /// 基类事件方法 初始模板信息 /// </summary> /// <param name="e"></param> public override void OnInitTemplateInfo(EventArgs e) { //创建首页页节点对象 NodeInfo cacheNodeById = Nodes.GetCacheNodeById(-2); if (cacheNodeById.IsCreateListPage) {///将正斜杠 (/) 追加到虚拟路径的末尾(如果尚不存在正斜杠) BasePage.ResponseRedirect(VirtualPathUtility.AppendTrailingSlash(base.Request.ApplicationPath) + cacheNodeById.ListHtmlPageName("0")); } //创建模板对象 TemplateInfo info2 = new TemplateInfo(); info2.QueryList = base.Request.QueryString; info2.PageName = TemplatePage.RebuildPageName(base.Request.Url.LocalPath, base.Request.QueryString); if (cacheNodeById.IsNull) { TemplatePage.WriteErrMsg("首页节点未找到"); } info2.TemplateContent = Template.GetTemplateContent(cacheNodeById.DefaultTemplateFile); info2.RootPath = HttpContext.Current.Request.PhysicalApplicationPath; info2.CurrentPage = DataConverter.CLng(base.Request.QueryString["page"], 1); info2.IsDynamicPage = true; //设置其模板信息 base.TemplateInfo = info2; }
public override void OnInitTemplateInfo(EventArgs e) { TemplateInfo info = new TemplateInfo(); info.QueryList = base.Request.QueryString; info.PageName = TemplatePage.RebuildPageName(base.Request.Url.LocalPath, base.Request.QueryString); info.TemplateContent = Template.GetTemplateContent(this.m_ModelInfo.CommentManageTemplate); info.RootPath = HttpContext.Current.Request.PhysicalApplicationPath; info.CurrentPage = DataConverter.CLng(base.Request.QueryString["page"], 1); base.TemplateInfo = info; }
public override void OnInitTemplateInfo(EventArgs e) { TemplateInfo info = new TemplateInfo(); info.QueryList = base.Request.QueryString; info.PageName = TemplatePage.RebuildPageName(base.Request.Url.LocalPath, base.Request.QueryString); info.TemplateContent = Template.GetTemplateContent("/其他模板/BaiDu地图模板.html"); info.RootPath = HttpContext.Current.Request.PhysicalApplicationPath; info.CurrentPage = DataConverter.CLng(base.Request.QueryString["page"], 1); info.IsDynamicPage = true; base.TemplateInfo = info; }
public override void OnInitTemplateInfo(EventArgs e) { string dynamicConfigTemplatePath = TemplatePage.GetDynamicConfigTemplatePath(Path.GetFileNameWithoutExtension(this.Page.Request.FilePath)); if (!string.IsNullOrEmpty(dynamicConfigTemplatePath)) { TemplateInfo info = new TemplateInfo(); info.QueryList = base.Request.QueryString; info.PageName = TemplatePage.RebuildPageName(base.Request.Url.LocalPath, base.Request.QueryString); info.TemplateContent = Template.GetTemplateContent(dynamicConfigTemplatePath); info.RootPath = HttpContext.Current.Request.PhysicalApplicationPath; info.CurrentPage = DataConverter.CLng(base.Request.QueryString["page"], 1); info.PageType = 1; base.TemplateInfo = info; } else { TemplatePage.WriteErrMsg("您查看的作者列表页未设置模板!", "Default.aspx"); } }
public override void OnInitTemplateInfo(EventArgs e) { TemplateInfo info = new TemplateInfo(); string keywordText = DataSecurity.FilterBadChar(BasePage.RequestString("keyword")); if (Keywords.Exists(keywordText)) { Keywords.UpdateHitsByKeywordName(keywordText); } info.QueryList = base.Request.QueryString; info.PageName = TemplatePage.RebuildPageName(base.Request.Url.LocalPath, base.Request.QueryString); string path = ""; path = "/其他模板/Tag标签页模板.html"; info.TemplateContent = Template.GetTemplateContent(path); info.RootPath = HttpContext.Current.Request.PhysicalApplicationPath; info.CurrentPage = DataConverter.CLng(base.Request.QueryString["page"], 1); info.IsDynamicPage = true; info.PageType = 1; base.TemplateInfo = info; }
public override void OnInitTemplateInfo(EventArgs e) { string str = BasePage.RequestString("updatetime"); DateTime?nullable = null; if (!string.IsNullOrEmpty(str)) { nullable = new DateTime?(DataConverter.CDate(str)); } string dynamicConfigTemplatePath = TemplatePage.GetDynamicConfigTemplatePath(Path.GetFileNameWithoutExtension(this.Page.Request.FilePath)); NameValueCollection values = new NameValueCollection(); values.Add("authorname", DataSecurity.FilterBadChar(BasePage.RequestString("authorname"))); if (!nullable.HasValue) { values.Add("updatetime", string.Empty); } else { values.Add("updatetime", nullable.Value.ToString("yyyy-MM-dd")); } if (!string.IsNullOrEmpty(dynamicConfigTemplatePath)) { TemplateInfo info = new TemplateInfo(); info.QueryList = values; info.PageName = TemplatePage.RebuildPageName(base.Request.Url.LocalPath, base.Request.QueryString); info.TemplateContent = Template.GetTemplateContent(dynamicConfigTemplatePath); info.RootPath = HttpContext.Current.Request.PhysicalApplicationPath; info.CurrentPage = DataConverter.CLng(base.Request.QueryString["page"], 1); info.PageType = 1; base.TemplateInfo = info; } else { TemplatePage.WriteErrMsg("您查看的作者未设置模板!", SiteConfig.SiteInfo.VirtualPath + "Default.aspx"); } }
public override void OnInitTemplateInfo(EventArgs e) { TemplateInfo info = new TemplateInfo(); int num = BasePage.RequestInt32("searchtype"); string str = DataSecurity.FilterBadChar(base.Request.QueryString["keyword"]); int modelId = BasePage.RequestInt32("ModelId"); string dynamicConfigTemplatePath = ""; NameValueCollection queryString = new NameValueCollection(); switch (num) { case 0: if (!string.IsNullOrEmpty(str)) { this.SaveKeyword(str); } queryString = base.Request.QueryString; dynamicConfigTemplatePath = TemplatePage.GetDynamicConfigTemplatePath("Search"); break; case 1: if ((DataSecurity.FilterBadChar(base.Request.QueryString["fieldoption"]) == "keyword") && !string.IsNullOrEmpty(str)) { this.SaveKeyword(str); } queryString = base.Request.QueryString; dynamicConfigTemplatePath = this.GetTemplateFile(modelId); break; case 2: if (BasePage.RequestInt32("showtype") != 1) { dynamicConfigTemplatePath = this.GetAdvanceTemplateForm(modelId); break; } queryString = base.Request.QueryString; dynamicConfigTemplatePath = this.GetAdvanceTemplateFile(modelId); break; case 3: { string[] strArray = DataSecurity.FilterBadChar(base.Request.QueryString["specialid"]).Split(new string[] { "|" }, StringSplitOptions.RemoveEmptyEntries); int specialid = DataConverter.CLng(strArray[1]); int specialcategoryid = DataConverter.CLng(strArray[0]); queryString.Add("specialid", specialid.ToString()); queryString.Add("specialcategoryid", specialcategoryid.ToString()); string str5 = DataSecurity.FilterBadChar(base.Request.QueryString["fieldoption"]); queryString.Add("fieldoption", str5); if ((str5 == "keyword") && !string.IsNullOrEmpty(str)) { this.SaveKeyword(str); } queryString.Add("keyword", str); dynamicConfigTemplatePath = this.GetSpecialTemplate(specialid, specialcategoryid); break; } default: queryString = base.Request.QueryString; if (!string.IsNullOrEmpty(str)) { this.SaveKeyword(str); } dynamicConfigTemplatePath = this.GetTemplatePath("Search"); break; } if (!string.IsNullOrEmpty(dynamicConfigTemplatePath)) { info.QueryList = queryString; info.PageName = TemplatePage.RebuildPageName(base.Request.Url.LocalPath, base.Request.QueryString); info.TemplateContent = Template.GetTemplateContent(dynamicConfigTemplatePath); info.RootPath = HttpContext.Current.Request.PhysicalApplicationPath; info.CurrentPage = DataConverter.CLng(base.Request.QueryString["page"], 1); info.IsDynamicPage = true; info.PageType = 1; base.TemplateInfo = info; } else { TemplatePage.WriteErrMsg("全站搜索结果页未设置模板!", "Default.aspx"); } }