c# - MVC Display Template for Summing Totals -
i want display summary totals in table-footer without creating special property in view-model.
however...the footer code fails, saying:
"templates can used field access, property access, single-dimension array index, or single-parameter custom indexer expressions."
footer code looks like:
<tfoot> <tr> <td colspan="6" class="bg-gray"></td> </tr> <tr> <td colspan="2"> totals not include price consessions </td> <td> @html.displayfor(modelitem => model.entities.sum( x => x.price)) </td> <td> @html.displayfor(modelitem => model.entities.sum(x => x.annualfee)) </td> <td> </td> </tr> </tfoot>
just leave out @html.displayfor
, put @model.entities.sum( x => x.price)
Comments
Post a Comment