1
當我有這樣的:奇怪的錯誤在Razor視圖,在果園CMS
@using Orchard.Themes.Models
@using Orchard.Themes.Preview
@using Orchard.Themes.Services
@using Orchard.Themes.ViewModels
@{
Script.Require("OrchardTinyMceDeluxe");
var pluginsBaseUrl = @Url.Content("~/modules/tinymcedeluxe/scripts/plugins");
var siteThemeService = WorkContext.Resolve<ISiteThemeService>();
}
我得到這個錯誤:
Parser Error Message: The code 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.
Line 4: @using Orchard.Themes.Services
Line 5: @using Orchard.Themes.ViewModels
Line 6: @{
Line 7: Script.Require("OrchardTinyMceDeluxe");
Line 8: var pluginsBaseUrl = @Url.Content("~/modules/tinymcedeluxe/scripts/plugins");
但是,如果我打破代碼爲兩個獨立的C#塊,如下所示,它工作正常。爲什麼?
@{
Script.Require("OrchardTinyMceDeluxe");
var pluginsBaseUrl = @Url.Content("~/modules/tinymcedeluxe/scripts/plugins");
}
@{
var siteThemeService = WorkContext.Resolve<ISiteThemeService>();
}
謝謝,就是這樣。我完全應該抓住這一點。 –