For some reason I can't seem to get my head around why I get a The if block is missing a closing "}" character. Make sure you have a matching "}" character for all the "{" characters within this block, and that none of the "}" characters are being interpreted as markup. error in my ASP.NET MVC Application.
@foreach (var image in Model.Images)
{
if (counter == Model.Images.Count - 1)
{
<div style="float: left; height: 250px; padding-right: 5px;">
}
else
{
<div style="float: left; height: 200px; padding-right: 5px;">
}
....
....
Prior to the above, I was simply doing: <div style="float: left; height: 200px; padding-right: 5px;">, however I am in need of this If Else to make it look better.
What am I doing wrong in the If Else statement?