事实上,我可以看到上面标记为可疑部分的代码是错误的,因为结束的“}”不是黄色的。
在页面顶部,我有一些 using 指令:
@using System.Configuration
@model CCRReporter.Models.TLISReportModel
@{
ViewBag.Title = "Transaction Line Item Sales Report Criteria";
ViewBag.PageName = ViewBag.Title;
}
...后面是脚本部分:
@section ScriptContent
{
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript" defer> </script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript" defer> </script>
// etc.
<script type="text/javascript">
var bSubmitting = false;
var WantsFocus = null;
var bFocusing = false;
var report_parms = null;
function SetTabOrder() {
$.each([
"#BeginDate",
"#BeginTime",
"#EndDate",
"#EndTime",
"#InputSite-input",
"#cmdAddSite",
"#InputDept-input",
"#cmdAddDept",
"#IncludeDepts",
"#ExcludeDepts",
"#UPCBeginsWith"],
function (i, n) {
$(n).prop("taborder", "y");
});
}
// ready handler
$(function() {
// etc.
...这个 jQuery 已经通过 jsfiddle/jshint 进行了验证。
这是 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 402:}
Line 403:
Line 404:@section MainHead
Line 405:{
Line 406: <link href="@Url.Content("http://code.jquery.com/ui/1.9.2/themes/smoothness/jquery-ui.css")" rel="stylesheet" type="text/css" />
Source File: /CCRReporter/Views/CCRCriteria/TLISReport.cshtml Line: 404
我已经多次查看所有这些代码,但不知道问题出在哪里。有没有人遇到过这个问题,或者知道找到问题所在的技巧?