模板页中定义标题,关键词,子页面设置关键字和标题

母板页:
HTML code
<head runat="server"> <title>无标题页</title> <meta name="keywords" id="k1" content="1,2,3"/> </head>
子页面内容标题和关键字
C# code
protected void Page_Load(object sender, EventArgs e) { this.Page.Title = "123"; HtmlMeta k1 = (HtmlMeta)this.Header.FindControl("k1"); if (k1 != null) { k1.Content = "新的keywords"; } }

posted @ 2011-04-07 10:50  咸鱼公子  Views(679)  Comments(0Edit  收藏  举报