Raffa Ferreira
Raffa Ferreira

Reputation: 115

Why my "<asp:ListView" isn't showing on the screen?

This is part of my code that isn't working. I have looked for somethings, but i cannot search what my asp:ListView isn't showing, if someone knows about it, Help me !

<asp:ListView  ItemPlaceholderID="PlaceHolder1" runat="server" ID="ListViewUser">
    <LayoutTemplate>
        <asp:PlaceHolder ID="PlaceHolder1" runat="server"/>
        <table id="Table1" class="TableListView" runat="server">
            <tr id="Tr1" class="TableHeader" runat="server">
                <td id="td1" runat="server">Nível</td>
                <td id="td2" runat="server">Descrição</td>
                <td id="td3" runat="server">Quantidade de Problema ?</td>
                <td id="td4" runat="server">Selecionar</td>
            </tr>
        </table>
    </LayoutTemplate>
    <ItemTemplate>
        <tr class="ItemsCSS">
            <td>
               <asp:Label runat="server"
                    ID="Label1"                                      
                    Text="Problema" >  
               </asp:Label>  
            </td>
            <td>
                <asp:Label runat="server"
                    ID="Label2"                                      
                    Text="Problema" >  
               </asp:Label>
            </td>
            <td>
                <asp:Label runat="server"
                    ID="Label3"                                      
                    Text="Problema" >  
               </asp:Label>
            </td>
        </tr>
    </ItemTemplate>
</asp:ListView>

Upvotes: 1

Views: 221

Answers (1)

andleer
andleer

Reputation: 22568

Your ListView lacks bindings. You can add a DataSourceID property to the top level control and point to a DataSource control or programmatically bind to the DataSource property and then invoke DataBind(). But the control will not display anything without first binding it.

Upvotes: 1

Related Questions