asp.net 网页标题、关键字、描述
2009-09-14 11:55 zhaoyang 阅读(604) 评论(0) 编辑 收藏 举报 在网页的开发中为了搜索引擎的优化,添加页面的title keyword description是最常用的方法之一。asp.net的方法代码如下所示:
public void SEO_HEAD(string title, string keyword, string description)
{
Page.Title = title + "--游戏学习网";
HtmlMeta metaKeyWords = new HtmlMeta();
HtmlMeta metaDescription = new HtmlMeta();
metaKeyWords.Name = "Keywords";
metaKeyWords.Content = keyword;
metaDescription.Name = "description";
metaDescription.Content = description;
Header.Controls.Add(metaKeyWords);
Header.Controls.Add(metaDescription);
}
public void SEO_HEAD(string title, string keyword, string description)
{
Page.Title = title + "--游戏学习网";
HtmlMeta metaKeyWords = new HtmlMeta();
HtmlMeta metaDescription = new HtmlMeta();
metaKeyWords.Name = "Keywords";
metaKeyWords.Content = keyword;
metaDescription.Name = "description";
metaDescription.Content = description;
Header.Controls.Add(metaKeyWords);
Header.Controls.Add(metaDescription);
}