.net用母版页和内容页实现动态Title(副标题_主标题)
一、母版页的Page_Load事件中加入:
Page.Header.Title += "主标题";
添加页面关键词和描述的方法:
HtmlMeta metaKeyWords = new HtmlMeta();
HtmlMeta metaDescription = new HtmlMeta();
metaKeyWords.Name = "Keywords";
metaKeyWords.Content ="关键词";
metaDescription.Name = "description";
metaDescription.Content ="描述";
Header1.Controls.Add(metaKeyWords);
Header1.Controls.Add(metaDescription);//Header1是head的id
二、内容页的Page_Load事件中加入:
Page.Header.Title="副标题"+"_";