Master Page Weirdness - “Content controls have to be top-level controls in a content page or a nested master page that references a master page.”

后端 未结 13 1998
借酒劲吻你
借酒劲吻你 2020-12-05 06:28

This is weird. I added a brand new Web Application project to my solution in Visual Studio 2008.

Created a master page. Made zero modifications. Created a new we

13条回答
  •  我在风中等你
    2020-12-05 06:36

    When you created the WebForm, did you select the Master page it is attached to in the "Add New Item" dialog itself ? Or did you attach it manually using the MasterPageFile attribute of the @Page directive ? If it was the latter, it might explain the error message you receive.

    VS automatically inserts certain markup in each kind of page. If you select the MasterPage at the time of page creation itself, it does not generate any markup except the @Page declaration and the top level Content control.

提交回复
热议问题