user2543573
user2543573

Reputation: 27

ASp.Net repeater control : error showing on binding repeater

It shows error "Non-invocable member 'System.Web.UI.WebControls.RepeaterItem.DataItem' cannot be used like a method.

for the <%# Container.DataItem("CostPageDescription")%>

my code below,

                 <td> Cost Page Description</td>
                 <td> Vendor Name</td>
                 <td> Bill Type</td>
             </tr>
      </HeaderTemplate>
      <ItemTemplate>
         <tr>
               <td> <%# Container.DataItem("CostPageDescription")%></td>
               <td> <%# Container.DataItem("VendorName")%> </td>
               <td> <%# Container.DataItem("BillType") %> </td>
         </tr>
         <tr>

Upvotes: 2

Views: 2925

Answers (2)

mshsayem
mshsayem

Reputation: 18008

Use this:

<%# Eval("CostPageDescription") %>

or this:

<%# DataBinder.Eval(Container.DataItem, "CostPageDescription") %>

First one is just a simplification of the second.

Upvotes: 0

Md. Parvez Alam
Md. Parvez Alam

Reputation: 4596

USE LIKE THIS

<td> <%# eval("CostPageDescription")%></td>

and at one place u left it blank, so make that correct

Upvotes: 5

Related Questions