• 页面类


    using System;
    using System.Collections.Generic;
    using Comm;
    /// <summary>
    ///ShowPage 的摘要说明
    /// </summary>
    public class ShowPage : System.Web.UI.Page
    {
        protected Util gjShowPage = new Util();
        protected MySqlExecute mseShowPage = new MySqlExecute();
        public ShowPage()
        {
            base.PreInit += new EventHandler(PaseBase_PreInit);
        }
        protected int PageIndex;
        public void PaseBase_PreInit(object sender, EventArgs e)
        {
            getThisPage();
            PageIndex = gjShowPage.getQueryStringInt("page");
            BindData();
        }
        protected virtual void BindData()
        {
    
        }
    
    
        private string _currentTitle;
        /// <summary>
        /// 页面标题
        /// </summary>
        public string CurrentTitle
        {
            get { return _currentTitle; }
            set { _currentTitle = value; }
        }
        /// <summary>
        /// 页面标题
        /// </summary>
        private string _currentKeywords;
    
        public string CurrentKeywords
        {
            get { return _currentKeywords; }
            set { _currentKeywords = value; }
        }
        private string _currentDescription;
    
        public string CurrentDescription
        {
            get { return _currentDescription; }
            set { _currentDescription = value; }
        }
        private void getThisPage()
        {
            string url = Request.RawUrl;
            List<MSEO> list = Cache["SEO"] as List<MSEO>;
            if (list == null)
            {
                System.Web.Caching.CacheDependency dep = new System.Web.Caching.CacheDependency(Server.MapPath("/App_Data/SEOSettingsInfo.xml"));
                list = new BSEO().getList("");
                if (list != null)
                {
                    Cache.Insert("SEO", list, dep);
                }
            }
            if (list != null)
            {
                foreach (MSEO model in list)
                {
                    if (System.Text.RegularExpressions.Regex.IsMatch(url, model.LookExpression.Trim(), System.Text.RegularExpressions.RegexOptions.IgnoreCase) && model.Enabled)
                    {
                        _currentTitle = model.PageTitle;
                        _currentKeywords = string.Format("<meta name='keywords' content='{0}' />", model.MetaKeywords);
                        _currentDescription = string.Format("<meta name='description' content='{0}' />", model.MetaDescription);
                        break;
                    }
                }
            }
        }
    }
  • 相关阅读:
    BZOJ1877: [SDOI2009]晨跑
    SPFA的两个优化:SLF与LLL
    BZOJ1858: [Scoi2010]序列操作
    java线程基础巩固---如何捕获线程运行期间的异常
    java线程基础巩固---如何给你的应用程序注入钩子程序
    类的命名空间与卸载详解及jvisualvm使用
    okhttp拦截器之RetryAndFollowUpInterceptor&BridgeInterceptor分析
    okhttp初识拦截器
    类加载器双亲委托机制实例深度剖析
    类加载器重要方法详解
  • 原文地址:https://www.cnblogs.com/daixingqing/p/2768446.html
Copyright © 2020-2023  润新知