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

c# - Better 64-bit byte array hash -

webrtc - Which ICE candidate am I using and why? -

php - Zend Framework / Skeleton-Application / Composer install issue -