2012-10-14 3 views
1

나는이 있습니다이상한 면도기보기에서 오류 과수원에서 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>(); 
} 

답변

2

Url.Content에서 @를 사용하면 안됩니다. 이미 코드 블록 안에 있습니다.

내가 생각하는 것은 면도날이 @와 끝에 세미콜론으로 혼란스러워서 HTML에 가까이있는 괄호를 배치한다는 것입니다.

+0

감사합니다. 나는 완전히 그것을 붙잡아 야했다. –