简体   繁体   English

类型为“ GridView”的控件“ ctl00_ContentPlaceHolder1_ gridview”必须置于“ ASP主页面”中

[英]Control 'ctl00_ContentPlaceHolder1_ gridview ' of type 'GridView' must be placed inside the form IN ASP MASTER PAGE

this is pradeep . 这是极好的。 We have to create Master Pages. 我们必须创建母版页。 we have to add Default page instead of Master pages. 我们必须添加默认页面而不是母版页面。

we have to apply the code . 我们必须应用代码。 I am getting error like this 我收到这样的错误

" Control 'ctl00_ContentPlaceHolder1_ gridview ' of type 'GridView' must be placed inside the form" “必须将“ GridView”类型的控件'ctl00_ContentPlaceHolder1_ gridview'放置在表单内部”

here goes my content page 这是我的内容页面

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

</asp:Content>

here goes my master page 这是我的主页

        <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server"   >

Put this code in your Code behind. 将此代码放在您的代码后面。

Public Overloads Overrides Sub VerifyRenderingInServerForm(ByVal control As Control)


End Sub

Make sure that the ContentPlaceholder is inside 确保ContentPlaceholder位于其中

<form runat="server">


</form>

A gridview must be placed in a server-side form. 必须以服务器端形式放置gridview。

<form id="frm" runat="server">
<asp:gridview />
</form>

That form can either reside on the content page, or it must surround the content placeholder on the master page. 该表单可以驻留在内容页面上,或者必须包围母版页上的内容占位符。 It must be one or the other - you can only have one server side form on a page. 它必须是一个或另一个-您在页面上只能有一个服务器端表单。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 类型为&#39;TextBox&#39;的控件&#39;ctl00_txtDebug&#39;必须放置在带有runat = server的表单标记中 - Control 'ctl00_txtDebug' of type 'TextBox' must be placed inside a form tag with runat=server 类型为“ RadioButton”的控件“ ctl00”必须置于带有runat = server的表单标记中 - Control 'ctl00' of type 'RadioButton' must be placed inside a form tag with runat=server &#39;TextBox&#39; 类型的控件 &#39;ctl00_TextBox1&#39; 必须放置在带有 runat=server 的表单标签内 - Control 'ctl00_TextBox1' of type 'TextBox' must be placed inside a form tag with runat=server 类型为“ DataControlLinkBut​​ton”的控件“ DataLoading1_gdvDataGroups_ctl01_ctl00”必须置于带有runat = server的表单标记中 - Control 'DataLoading1_gdvDataGroups_ctl01_ctl00' of type 'DataControlLinkButton' must be placed inside a form tag with runat=server 类型为“ GridView”的控件“ MainContent_GridView1”必须置于带有runat = server的表单标记中 - Control 'MainContent_GridView1' of type 'GridView' must be placed inside a form tag with runat=server 必须将带有&#39;GridView&#39;类型的控件&#39;GridView1&#39;放在带有runat = server的表单标签内。 - Control 'GridView1' of type 'GridView' must be placed inside a form tag with runat=server.? &#39;Button&#39; 类型的控件 &#39;ContentPlaceHolder1_Button1&#39; 必须放置在带有 runat=server 的表单标签内 - Control 'ContentPlaceHolder1_Button1' of type 'Button' must be placed inside a form tag with runat=server 类型为&#39;TextBox&#39;的控件&#39;ctl07&#39;必须放置在带有runat = server的表单标记中。 - Control 'ctl07' of type 'TextBox' must be placed inside a form tag with runat=server. 'Button' 类型的控件 'ctl02' 必须放置在带有 runat=server 的表单标签内 - Control 'ctl02' of type 'Button' must be placed inside a form tag with runat=server 当输入控件放置在asp GridView中时,页面加载不触发 - Page Load not firing when input control placed in an asp GridView
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM