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 1905
借酒劲吻你
借酒劲吻你 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:53

    Your web form shouldn't have all of that markup (like the tag). Since it has a master page, you just start with the content tag. Your aspx page should look like this:

    <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Default.aspx.vb" Inherits="WebUI._Default" MasterPageFile="~/Site1.Master" %>
    
    
       This is the body!
    
    

    When you're adding a new aspx page make sure to check "select master page" in the "add new item" dialog.

提交回复
热议问题