动态修改页面的Title, Keywords and Description
来源:未知 责任编辑:责任编辑 发表时间:2015-03-01 01:33 点击:次
protected void LoadPageProperty()
p> {
p> pagePropertyModel = pageProperty.GetModel();
p> //Description
p> HtmlMeta desc = new HtmlMeta();
p> desc.Name = "Description";
p> desc.Content = pagePropertyModel.Desc_Content;
p> Page.Header.Controls.Add(desc);
p> //Keyword
p> HtmlMeta keywords = new HtmlMeta();
p> keywords.Name = "keywords";
p> keywords.Content = pagePropertyModel.Keywords_Content;
p> Page.Header.Controls.Add(keywords);
p>
p> //Page title
p> Page.Title = pagePropertyModel.Title;
p> ////Encode/Content type
p> //HtmlMeta encode = new HtmlMeta();
p> //encode.HttpEquiv = "Content-Type";
p> //encode.Content = "text/html; charset=utf-8";
p> //Page.Header.Controls.Add(encode);
p> ////Language
p> //HtmlMeta lang = new HtmlMeta();
p> //lang.HttpEquiv = "Content-Language";
p> //lang.Content = "zh-cn";
p> //Page.Header.Controls.Add(lang);
p> ////Description
p> //HtmlMeta desc = new HtmlMeta();
p> //desc.Name = "Description";
p> //desc.Content = "Test the meta controls,FCC";
p> //Page.Header.Controls.Add(desc);
p> ////Keyword
p> //HtmlMeta keywords = new HtmlMeta();
p> //keywords.Name = "keywords";
p> //keywords.Content = "title,meta,test,page,FCC检测";
p> //Page.Header.Controls.Add(keywords);
p> ////Link/CSS
p> ////HtmlLink cssLink = new HtmlLink();
p> ////cssLink.Href = "MasterPage.css";
p> ////cssLink.Attributes.Add("rel", "stylesheet");
p> ////cssLink.Attributes.Add("type", "text/css");
p> ////Page.Header.Controls.Add(cssLink);
p> }
相关新闻>>
最新推荐更多>>>
- 发表评论
-
- 最新评论 更多>>