一、修改 Master Page 的标题部分
HtmlHead head=this.Master.Page.Header; //...... HtmlMeta meta=new HtmlMeta(); meta.Name="Keywords"; meta.Content="xxx网是全宇宙最牛X的网站"; head.Controls.Add(meta);
二、 查找MasterPage中的控件(内容页用母版页中的东东)
(1).FindControl方法:this.Master.Page.Form.FindControl("控件名")
(2).在MasterPage定义属性:
public XXX控件类型 MyXXXControl
{
get{return this.XXXControl;}
}
使用时:MasterPage的类名 master = (MasterPage的类名)this.Master;
(3).MasterType指令
在内容页头加入:
代码中可直接使用了:this.Master.控件名.BackColor = System.Drawing.Color.Green;