简体   繁体   中英

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"

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

<form runat="server">


</form>

A gridview must be placed in a server-side form.

<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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM