Hi,
I have a ListView on my checkout page with an ItemTemplate which build up a table of items ordered by customer. I want to add a total in the footer of the table, I have the following markup:
<asp:ListView ID="lvOrderSummary" runat="server">
<LayoutTemplate>
<table id="tblOrderSummary">
<tr>
<td><b>Title</b></td>
<td><b>Cost</b></td>
</tr>
<asp:PlaceHolder ID="itemPlaceholder" runat="server" />
<tr>
<td><b>Total Cost:</b></td>
<td><%# GetTotalCost().ToString()%></td>
</tr>
</table>
</LayoutTemplate>
<ItemTemplate>
<tr>
<td><%#Eval("Title") %></td>
<td><%#Eval("Cost") %> </td>
</tr>
</ItemTemplate>
</asp:ListView>
I have a server side method called GetTotalCost that return the value I require. The problem I'm having is that this method is never called. I have also tried and instead of using:
<td><%# GetTotalCost().ToString()%></td>
I've tried using
<td id="tdTotal" runat="server"></td>
---------------
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
TableCell td = ((TableCell)this.FindControl("lvOrderSummary_tdTotal"));
}
}