62,272
社区成员
发帖
与我相关
我的任务
分享
Page.Header.Title = "编程改变内容页标题";
//修改head标签包含的其它标签属性,间接修改了页面背景颜色
Style myStyle = new Style();
myStyle.BackColor = System.Drawing.Color.Red;
Page.Header.StyleSheet.CreateStyleRule(myStyle, null, "html");
//添加新标签meta到head标签中
HtmlMeta metaKeywords = new HtmlMeta();
metaKeywords.Name = "KEYWORDS";
metaKeywords.Content = "asp.net,c#";
HtmlHead head = Page.Header;
head.Controls.Add(metaKeywords);
<title>
<asp:ContentPlaceHolder ID="head" runat="server">
</asp:ContentPlaceHolder>
</title>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
演示设置Title
</asp:Content>