c# - as.net repeater does not contain a definition for repeater -


i trying create asp.net table repeater. here code creating table:

    <table class="pageviewtable" align="centre" border="1">         <tr bgcolor="green">             <th>datetime</th>             <th>page</th>             <th>location</th>             <th>ip address</th>         </tr>         <asp:repeater id="tablerepeater" runat="server" >                    <itemtemplate>                 <tr>                     <td><%#container.dataitem("datetime")%></td>                     <td><%#container.dataitem("page")%></td>                     <td>::location</td>                     <td><%#container.dataitem("ipaddress")%></td>                 </tr>             </itemtemplate>         </asp:repeater>          </table>  

i have seen many other examples of how create repeater in table 1 page load.

i create arraylist of class:

public class pageviews     {         public string datetime {get; set;}         public string ipaddress {get; set;}         public string page {get; set;}         public string location {get; set;}     } 

and populate it. next try bind arrylist table by:

    tablerepeater.datasource = pviews;     tablerepeater.databind(); 

where:

list <pageviews> pviews = new list<pageviews>(); 

but following error:

 cs1061: 'system.web.ui.webcontrols.repeater' not contain definition 'datasource' , no extension method 'datasource' accepting first argument of type 'system.web.ui.webcontrols.repeater' found (are missing using directive or assembly reference?) 

here namespaces in project:

using system; using system.web.configuration;  using system.data.sqlclient; using system.collections.generic; using system.linq; 

i suspect have number of errors, not sure are.

i have tried numerous tutorials, cannot seem work. coding in notepad++ please not suggest use vs trying learn how intellisense.

c# case sensitive , hence should datasource


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -