现在的位置: 主页 > 新闻中心 > 文章正文

动态修改页面的Title, Keywords and Description

作者:福州市名人视觉形象设计职业培训学校 来源:www.mrssjy.com 发布时间:2017-09-07 12:35:34
动态修改页面的Title, Keywords and Description protected void LoadPageProperty()

{

pagePropertyModel = pageProperty.GetModel();

//Description

HtmlMeta desc = new HtmlMeta();

desc.Name = "Description";

desc.Content = pagePropertyModel.Desc_Content;

Page.Header.Controls.Add(desc);

//Keyword

HtmlMeta keywords = new HtmlMeta();

keywords.Name = "keywords";

keywords.Content = pagePropertyModel.Keywords_Content;

Page.Header.Controls.Add(keywords);

//Page title

Page.Title = pagePropertyModel.Title;

////Encode/Content type

//HtmlMeta encode = new HtmlMeta();

//encode.HttpEquiv = "Content-Type";

//encode.Content = "text/html; charset=utf-8";

//Page.Header.Controls.Add(encode);

////Language

//HtmlMeta lang = new HtmlMeta();

//lang.HttpEquiv = "Content-Language";

//lang.Content = "zh-cn";

//Page.Header.Controls.Add(lang);

////Description

//HtmlMeta desc = new HtmlMeta();

//desc.Name = "Description";

//desc.Content = "Test the meta controls,FCC";

//Page.Header.Controls.Add(desc);

////Keyword

//HtmlMeta keywords = new HtmlMeta();

//keywords.Name = "keywords";

//keywords.Content = "title,meta,test,page,FCC检测";

//Page.Header.Controls.Add(keywords);

////Link/CSS

////HtmlLink cssLink = new HtmlLink();

////cssLink.Href = "MasterPage.css";

////cssLink.Attributes.Add("rel", "stylesheet");

////cssLink.Attributes.Add("type", "text/css");

////Page.Header.Controls.Add(cssLink);

企业建站2800元起,携手武汉肥猫科技,做一个有见地的颜值派!更多优惠请戳:武汉网站建设公司 https://www.jingchucn.com/zt/wuhan_wangzhanjianshe/

上一篇:ASP.Net应用递归算法案例 下一篇:最后一页