Click here to Skip to main content
16,018,249 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
Control 'GridView1' of type 'GridView' must be placed inside a form tag with runat=server.


What I have tried:

ASP.NET
<form id="form1" runat="server">
<table id="wrapper" align="center" cellpadding="0" cellspacing="0">
    <tr>
        <td>
            <table id="maintable" align="center" cellpadding="0" cellspacing="0">
                <tr>
                    <td class="headtd">
                    </td>
                </tr>
                <tr>
                    <td class="br">
                    </td>
                </tr>
                <tr>
                    <td class="menutd">
                        <div class="top_menu_nav" id="chromemenu">
                            <ul>
                                <li><a href="AddMembership.aspx" title="ADDMEMBER" >ADDMEMBER</a></li>
                                <li><a href="ShowMemberDetails.aspx" title="MEMBERDETAILS" class="current">SHOWMEMBER</a></li>
                                <li><a href="Login.aspx" title="Contact">LOGOUT</a></li>
                            </ul>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td class="br">
                    </td>
                </tr>
                <tr>
                    <td class="contenttd" valign="top">
                        <table id="content" align="center" cellpadding="0" cellspacing="0">
                            <tr>
                                <td class="leftcon">
                                    <table id="divcontent" align="center" cellpadding="0" cellspacing="0">
                                        <tr>
                                            <td valign="top">
                                                <div align="center">
                                                    <table class="inner" align="center">
                                                        <tr>
                                                            <td>
                                                                MEMBER DETAILS
                                                            </td>
                                                        </tr>
                                                        <tr><td></td></tr>
                                                        <tr><td>
                                                            <asp:GridView ID="GridView1" runat="server"
                                                                style="font-size: large; font-family: 'Times New Roman', Times, serif"
                                                                AutoGenerateColumns="False">
                                                                <Columns>
                                                                    <asp:BoundField DataField="Name" HeaderText="Name" />
                                                                    <asp:BoundField DataField="Father Name" HeaderText="Father Name" />
                                                                    <asp:BoundField DataField="Address" HeaderText="Address" />
                                                                    <asp:BoundField DataField="Village" HeaderText="Village" />
                                                                    <asp:BoundField DataField="District" HeaderText="District" />
                                                                    <asp:BoundField DataField="Mobile" HeaderText="Mobile" />
                                                                </Columns>
                                                            </asp:GridView>
                                                        </td></tr>
                                                    </table>
                                                </div>
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                                <td class="centre">
                                    <%-- THis is CEntre--%>
                                </td>
                                <td class="rightcon">
                                    <table class="righttable" cellpadding="0" cellspacing="0">
                                        <tr>
                                            <td>
                                                <asp:Button ID="Button1" runat="server" Text="Export"
                                                    Style="margin-top: -166px" onclick="Button1_Click" />
                                                <%--  USe SOMe --%>
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td class="br">
                    </td>
                </tr>
                <tr>
                    <td class="foottd" valign="middle">
                        <span class="cpyrgt">Copyrights @ Sri SivaSelvi Amman Temple </span><span class="powered">
                            Powered By <a href="http://www.globalsoftinfotech.co.in" target="_blank">Globalsoft
                                Infotech</a></span>
                    </td>
                </tr>
            </table>
        </td>
    </tr>
</table>
</form>
Posted
Updated 1-Dec-16 19:04pm

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900