我有這個宏在運行服務器上快樂地運行。在WebMatrix中可以。現在WebMatrix中完成自我更新2(刷新),它不會運行一些宏,這是其中之一: -Umbraco Razor語法問題
@{
//Check there are slider image page loaded
var theCount = @Model.Descendants("SliderImagePage").Count();
if (theCount > 0)
{
foreach (var theImagePage in Model.Descendants("SliderImagePage"))
{
var theImage = theImagePage.Media("sliderImage","umbracoFile");
if (theImagePage.IsFirst())
{
@:<div class="slide" style="background-image:url('@Html.Raw(theImage)');display:block;"></div>
} else {
@:<div class="slide" style="background-image:url('@Html.Raw(theImage)');display:none;"></div>
}
}
}
else
{
@: No Picture Image pages set up
}
}
它抱怨「:」是不是在一個代碼塊的開始有效。
我有MVC4和VS2010中的剃刀擴展。據我瞭解,這一切都是有效的。任何人都可以闡明爲什麼它不會通過驗證?
謝謝。
謝謝,刪除他們,但仍VS2010抱怨了@:無圖像的圖像行,以便把它在@ Html.Raw( 「在這裏」);似乎已經過去了。 – Craig