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>             &nbsp;         </td>     </tr> </tfoot> 

just leave out @html.displayfor , put @model.entities.sum( x => x.price)


Comments

Popular posts from this blog

android - questions about switching from C2DM to GCM -

c++ - Qt setGeometry: Unable to set geometry -

batch file - How to extract all multi-volume RAR archives from subfolders of a folder? -