给页面添加关键词和简介
1.取出数据,即可存储在XML文档中
DataTable dt = DBHelper.GetDataSet("select * from SEO where id=1");
2.创建实例
HtmlMeta metaKeyWords = new HtmlMeta();
3.定义名称
metaKeyWords.Name = "Keywords";
4.定义内容
metaKeyWords.Content = Convert.ToString(dt.Rows[0]["keyword"]);
5.添加到页面
this.Page.Header.Controls.Add(metaKeyWords);
HtmlMeta metaDescription = new HtmlMeta();
metaDescription.Name = "description";
metaDescription.Content = Convert.ToString(dt.Rows[0]["description"]);
this.Page.Header.Controls.Add(metaDescription);