Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/31.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net ASP页面中的HTML控件_Asp.net - Fatal编程技术网

Asp.net ASP页面中的HTML控件

Asp.net ASP页面中的HTML控件,asp.net,Asp.net,我是ASP.NET新手。当我在.aspx页面中编写代码时,我试图在其中使用HTML标记,然后出现以下错误: 仅允许在包含内容控件的内容页中直接使用内容控件 有人能提出解决办法吗?如何使用这些标记?如果您在该页面中使用母版页,请确保所有html和服务器控件都由内容控件包装 <asp:Content ContentPlaceHolderID="MainContent" runat="server"> html...... </asp:Content> html。。。。。。

我是ASP.NET新手。当我在
.aspx
页面中编写代码时,我试图在其中使用HTML标记,然后出现以下错误:

仅允许在包含内容控件的内容页中直接使用内容控件


有人能提出解决办法吗?如何使用这些标记?

如果您在该页面中使用母版页,请确保所有html和服务器控件都由内容控件包装

<asp:Content ContentPlaceHolderID="MainContent" runat="server">
html......
</asp:Content>

html。。。。。。

如果您在该页面中使用母版页,请确保所有html和服务器控件都由内容控件包装

<asp:Content ContentPlaceHolderID="MainContent" runat="server">
html......
</asp:Content>

html。。。。。。

您要添加什么控件?您如何尝试添加它(在标记或代码隐藏中)?请更新问题以显示不起作用的代码。您正在尝试添加什么控件?您如何尝试添加它(在标记或代码隐藏中)?请更新问题以显示不工作的代码。