When you insert HTML elements into your Razor file, it escapes out of C# mode, so you need to add the @
sign to your variable calls.
EDIT: You also need the @
sign on the while
and declaration statements:
@{ int i = 0; }
@while(list[i] != null)
{
<dl class="dl-horizontal">
<dt>
@list[i].Name
</dt>
<dd>
@list[i].Damage
</dd>
</dl>
i++;
}
This will put you back into the C# context and evaluate the expression.