开发者

Asp.net master page

开发者 https://www.devze.com 2023-02-01 05:33 出处:网络
how 开发者_StackOverflow中文版to Bind webpages that\'s already created with a new master page ?AT Page_PreInit event you can set 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号