0

Hi if I have some code like:

for (int i = 0; i < Model.TestDtos.Count; i++)
  {

    <tr>                            
      <td>@Model.TestDtos[i].Quantity * @Model.TestDtos[i].PaymentRate</td>
    </tr>
  }

So what happesn is that say for a particular iteration Quantity is 5 and payment rate of 7 the text in the tag equals 5 * 7.

That makes sense but really I want it to be evaluated.

Is there a way to tell it to evaluate this expression and instead show 35?

4

1 回答 1

2

只需将表达式括在括号中:

@(Model.TestDtos[i].Quantity * Model.TestDtos[i].PaymentRate)
于 2013-07-15T20:59:42.400 回答