Reputation: 17348
I have an ASP.NET MVC 4 view where I have an embedded code block, like this:
@using System.Collections.Generic
@{
PortfolioOverviewModel item = @Model.Items[0];
//Configuration
int[] bootstrapGridValues = new int[]{12, 6, 6, 4, 4, 4};
int deviceWidth = 800;
// More code
}
The problem is, the closing }
of the array is causing IntelliSense, and the compiler to break. Instead of closing the array, it thinks that it closes the whole code block:
@using System.Collections.Generic
@{
PortfolioOverviewModel item = @Model.Items[0];
//Configuration Closes the whole block v
int[] bootstrapGridValues = new int[]{12, 6, 6, 4, 4, 4};
int deviceWidth = 800; // Not recognized as code
// More code
} // Not recognized as the closing brace
Why is it mixing up my braces? Is there a way I can work around this?
Note: This is the entire code block. I'm not snipping out code where I may have forgotten to close an earlier brace.
Upvotes: 1
Views: 128
Reputation: 3191
remove @ from PortfolioOverviewModel item = @Model.Items[0];
it should be like following :
PortfolioOverviewModel item = Model.Items[0];
Upvotes: 1