Пример #1
0
 /// <summary>
 /// 菜单SEO信息
 /// </summary>
 /// <param name="MenuId"></param>
 public static SeoInfo MenuSeoInfo(string MenuId)
 {
     var model = BIndexAndMenu.MenuSeoInfo(MenuId);
     if (model != null)
     {
         var si = new SeoInfo
         {
             WebTitle = model.seotitle,
             Keywords = model.seokeyword,
             Description = model.seodesc
         };
         return si;
     }
     else
     {
         return null;
     }
 }
Пример #2
0
 /// <summary>
 /// SEO 设置
 /// </summary>
 /// <param name="model"></param>
 protected void SetSeoInfo(SeoInfo model)
 {
     if (model != null)
     {
         if (!String.IsNullOrWhiteSpace(model.WebTitle))
             this.Header.Title = model.WebTitle;
         if (!String.IsNullOrWhiteSpace(model.Keywords))
             AddMetaTag("keywords", model.Keywords);
         if (!String.IsNullOrWhiteSpace(model.Description))
             AddMetaTag("description", model.Description);
         SetStatPageViewInfo();
     }
 }