Asp.net master page
how 开发者_StackOverflow中文版to Bind webpages that's already created with a new master page ?
AT Page_PreInit event you can set master page.
for example
protected void Page_PreInit(object sender, EventArgs e)
{
this.MasterPageFile = "Master.master";
}
You will need to change the markup in the .aspx file something along the following lines
1) Remove html head & body
2) Insert ASP:CONTENT tag
3) Insert MasterPageFile attribute in @PAGE directive
To be honest the easiest way might be to just create a new content page, select the masterpage and then copy any markup you need into the panel and copy your codebehind over too.
精彩评论