content is not supported outside 'script" or asp content' region

https://stackoverflow.com/questions/48915080/asp-net-content-is-not-supported-outside-the-script-or-aspcontent

https://forums.asp.net/t/1205746.aspx?content+is+not+supported+outside+script+or+asp+content+region

asp.net web application有master page

新增的page如果需要增加内容,需要使用asp:content

<asp:content id="Content1" contentplaceholderid="ContentPlaceHolder1" runat="Server">
    <script type="text/javascript">
        alert("Hello, World!");
    </script>
</asp:content>

the required attribute contentplaceholderid is not found on content control

https://stackoverflow.com/questions/27688659/verify-content-controls-contentplaceholderid-attribute-in-the-content-page

在master page上有对应的,两边的id需要匹配上

<asp:ContentPlaceHolder ID="cphMain" runat="server">
</asp:ContentPlaceHolder>

输入ContentPlaceHolderID之后,会自动提示master page上有哪几个place holder可以用

原文地址:https://www.cnblogs.com/chucklu/p/11009572.html