Why does the first segment work and the second throw an "Invalid expression term '<
' error at the label tag?
First segment:
@foreach( var f in new List<List<string>>{ new List<string>{ new List<string>{ "PumpSize", "Pump Size" },
new List<string>{ "PumpType", "Pump Type" },
new List<string>{ "WellHead", "Well Head" } } )
{
<label>@f[1]
</label>
}
Second segment:
@{
var fields = new List<List<string>>{ new List<string>{ new List<string>{ "PumpSize", "Pump Size" },
new List<string>{ "PumpType", "Pump Type" },
new List<string>{ "WellHead", "Well Head" } };
fields.ForEach( f =>
{
<label>@f[1]</label>
} );
}
The error I get is with the <label>
, "Invalid expression term '<
'.
If it matters, my browser is IE9.