Gridview表不可见,html不呈现

时间:2011-04-20 22:52:42

标签: asp.net gridview

我有一个绑定到objectdatasource的gridview。它正在获取数据,数据在html标记中 - 我只是看不到它!

这是default.aspx:

<%@ Page Language =“C#”AutoEventWireup =“true”CodeBehind =“Default.aspx.cs”Inherits =“memorywell_2._Default”%>

    Memorywell信息服务           

<asp:ObjectDataSource ID="resumesource" runat="server" SelectMethod="FetchAllGigs" EnablePaging="false" 
 DataObjectTypeName="memorywell_2DataModel.Resume" TypeName="memorywell_2DataModel.Resume">   
</asp:ObjectDataSource>    
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false" DataSourceID="resumesource" AllowPaging="false" PageSize="10">
     <EmptyDataTemplate>
        No data for your query.</EmptyDataTemplate>
    <Columns>
     <asp:TemplateField>
            <ItemTemplate>
               Description: <%# Eval("Description") %>
            </ItemTemplate>
        </asp:TemplateField>
    </Columns>
    </asp:GridView>

</form>

这是我浏览器中“查看页面源”的html:

    Memorywell信息服务           

    <div>
<table cellspacing="0" rules="all" border="1" id="GridView1" style="border-collapse:collapse;">
    <tr>
        <th scope="col">&nbsp;</th>
    </tr><tr>
        <td>
               Description: (Contract)  Maintain 4 websites including a national site that receives 80,000 hits per month.  Develop new sites and custom modules in C# and MS SQL for DotNetNuke content management system.  Developing new internationally targeted community site that includes custom C# modules for product reviews.                                                                                                                                                                                                                  
            </td>
    </tr>
</table>

</form>

1 个答案:

答案 0 :(得分:0)

根据您提供的HTML,您应该有一个包含一个单元格和内部文本的表格(请参阅jsfiddle和您的HTML)
检查您的表是否在隐藏的容器(可能是某些DIV)内。