protected void Page_Load(object sender, EventArgs e)
{
string strTitle = "My title for this page"; //设置页面的Title
Page.Title = strTitle;
HtmlMeta tag = new HtmlMeta();
tag.Name = "keywords";
tag.Content = "keyword1,keyword2";
Header.Controls.Add(tag); //<meta name="keywords" content="keyword1,keyword2" />
tag = new HtmlMeta();
tag.Name = "description";
tag.Content = "My description for this page";
Header.Controls.Add(tag); //<meta name="description" content="My description for this page" />
}
设置网页的Title、keywords和description
最新推荐文章于 2021-08-25 11:50:08 发布