我的 asp.net razor (cshtml) 文件无法加载;YSOD 说:
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: Section blocks ("@section Header { ... }") cannot be nested. Only one level of section blocks are allowed.
Source Error:
Line 239:}
Line 240:
Line 241:@section MainHead
Line 242:{
Line 243: <link type="text/css" href="http://code.jquery.com/ui/1.9.2/themes/smoothness/jquery-ui.css" rel="stylesheet"></link>
Source File: /TLDReporter/Views/TLDCriteria/ReceiptCriteria.cshtml Line: 241
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1008
文件中的块是:
@section ScriptContent
{
// references to css and js, followed by jQuery code
}
@section MainHead
{
// style/CSS block
}
@using (Html.BeginForm())
{
// HTML
}
如上所述,它们都具有打开和关闭大括号,并且每个都在前一个被关闭之后开始。那么为什么渲染引擎认为我有嵌套的节块?