C# Asp.Net仅将GridView渲染到表

C# Asp.Net仅将GridView渲染到表,c#,asp.net,gridview,C#,Asp.net,Gridview,我应该在我的网页上向用户显示表格信息。我使用GridView: <asp:Content runat="server" ID="BodyContent" ContentPlaceHolderID="MainContent"> <asp:GridView Id="report2_gridView" runat="server" HeaderStyle-BackColor="#3AC0F2" HeaderStyle-ForeColor="White"

我应该在我的网页上向用户显示表格信息。我使用GridView:

    <asp:Content runat="server" ID="BodyContent" ContentPlaceHolderID="MainContent">
    <asp:GridView Id="report2_gridView" runat="server" HeaderStyle-BackColor="#3AC0F2" HeaderStyle-ForeColor="White"
                                  ShowHeaderWhenEmpty="true" AutoGenerateColumns="false">
                        <Columns>
                            <asp:BoundField DataField="CommutatorIp"             HeaderText="Commutator"                                        ItemStyle-Width="150" />
                            <asp:BoundField DataField="SomeData1"                        HeaderText="SomeData1"                                           ItemStyle-Width="150" />
                            <asp:BoundField DataField="SomeData2"                                HeaderText="SomeData2"                                    ItemStyle-Width="150" />
                            <asp:BoundField DataField="SomeData3"                              HeaderText="SomeData3"                                    ItemStyle-Width="150" />
                            <asp:BoundField DataField="SomeData4"                               HeaderText="SomeData4"                                      ItemStyle-Width="150" />
                        </Columns>
                    </asp:GridView>

</asp:Content>

但当浏览器呈现我的页面时,GridView转换为:

<div>
    <table cellspacing="0" rules="all" border="1" id="MainContent_report2_gridView" style="border-collapse:collapse;">
        <tbody><tr style="color:White;background-color:#3AC0F2;">
            <th scope="col">Commutator</th><th scope="col">SomeData1</th><th scope="col">SomeData2</th><th scope="col">SomeData3</th><th scope="col">SomeData4</th>
        </tr><tr>
            <td style="width:150px;">1.1.1.1</td><td style="width:150px;">1somedata1</td><td style="width:150px;">1somedata2</td><td style="width:150px;">1somedata3</td><td style="width:150px;">1somedata4</td>
        </tr><tr>
            <td style="width:150px;">2.2.2.2</td><td style="width:150px;">2somedata1</td><td style="width:150px;">2somedata2</td><td style="width:150px;">2somedata3</td><td style="width:150px;">2somedata4</td>
        </tr><tr>
            <td style="width:150px;">3.3.3.3</td><td style="width:150px;">3somedata1</td><td style="width:150px;">3somedata2</td><td style="width:150px;">3somedata3</td><td style="width:150px;">3somedata4</td>
        </tr><tr>
            <td style="width:150px;">1.1.1.1</td><td style="width:150px;">mega</td><td style="width:150px;">mega2</td><td style="width:150px;">mega3</td><td style="width:150px;">mega4</td>
        </tr>
    </tbody></table>
</div>

换向器SOMEDATA1SOMEDATA2SOMEDATA3SOMEDATA4
1.1.1.11somedata11somedata21somedata31somedata4
2.2.2.22somedata12somedata22somedata32somedata4
3.3.3.33somedata13somedata23somedata33somedata4
1.1.1.1兆欧2兆欧3兆欧4

一切都很好,但我不需要div元素!如何将GridView转换为不带div的表?

这里有两个副本(虽然不是很有用):我可以问一下为什么您不想要
div
?我已经尝试使用第一个链接中的解决方案,但它对我不起作用。现在我将尝试第二种解决方案。