出于某种原因,我似乎无法理解为什么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.
在我的 ASP.NET MVC 应用程序中出现错误。
@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;">
}
....
....
在上述之前,我只是在做:<div style="float: left; height: 200px; padding-right: 5px;">
,但是我需要这个 If Else 让它看起来更好。
我在 If Else 语句中做错了什么?