由於某種原因,我似乎無法理解爲什麼我的ASP.NET MVC應用程序中出現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 If語句中做錯了什麼?
前面追加
@:
您必須首次使用@。所以在別的之前不要再使用@ – CocLn我以前也試過,但它不起作用。 – Subby