Asp.Net4 Javascript/jquery缩小错误

Asp.Net4 Javascript/jquery缩小错误,javascript,jquery,refactoring,asp.net-mvc-4,Javascript,Jquery,Refactoring,Asp.net Mvc 4,我意识到这可能很愚蠢,这可能是由于我缺乏javascript/jquery知识(在重新分解等方面)造成的 我正在页面上呈现一个JQGrid组件,如下所示。 <script src="@System.Web.Optimization.BundleTable.Bundles.ResolveBundleUrl("~/JQGrid")" type="text/javascript"></script> <script type="text/javascript">

我意识到这可能很愚蠢,这可能是由于我缺乏javascript/jquery知识(在重新分解等方面)造成的

我正在页面上呈现一个JQGrid组件,如下所示。

<script src="@System.Web.Optimization.BundleTable.Bundles.ResolveBundleUrl("~/JQGrid")" type="text/javascript"></script>
<script type="text/javascript">

    var colNames = ['S ID', 'Shift Description'];
    var colModel = [
            { name: 'S_ID', index: 'S_ID', key: true, width: 55, editable: false, hidden: true, search: false },
            { name: 'Shift_Description', index: 'Shift_Description', width: 100, align: "right", editable: true, editrules: { required: true }, formoptions: { rowpos: 1, colpos: 1}}];

    RenderJQGrid("#theGrid", '#pager', '@ViewBag.Title', 600, colNames, colModel, 'S_ID', null, null, null, '@Url.Action("GridData")', '@Url.Action("Add")', '@Url.Action("Edit")', '@Url.Action("Delete")', '@Url.Action("ExportToExcel")');

</script>
不过我在fiddler中收到了这个错误。

<script src="@System.Web.Optimization.BundleTable.Bundles.ResolveBundleUrl("~/JQGrid")" type="text/javascript"></script>
<script type="text/javascript">

    var colNames = ['S ID', 'Shift Description'];
    var colModel = [
            { name: 'S_ID', index: 'S_ID', key: true, width: 55, editable: false, hidden: true, search: false },
            { name: 'Shift_Description', index: 'Shift_Description', width: 100, align: "right", editable: true, editrules: { required: true }, formoptions: { rowpos: 1, colpos: 1}}];

    RenderJQGrid("#theGrid", '#pager', '@ViewBag.Title', 600, colNames, colModel, 'S_ID', null, null, null, '@Url.Action("GridData")', '@Url.Action("Add")', '@Url.Action("Edit")', '@Url.Action("Delete")', '@Url.Action("ExportToExcel")');

</script>
/*缩小失败。返回未统一的内容

(1,10):运行时错误CSS1031:找到预期的选择器 'RenderJQGrid''

(1,10):运行时错误CSS1025:应为逗号或大括号,已找到 'RenderJQGrid''

*/


我做错了什么/丢失了什么?当代码嵌入html页面时似乎还不错?

我遇到了类似的问题。我的问题是我使用样式包绑定*.js文件

我遇到了类似的问题。我的问题是我使用样式包绑定*.js文件

不,我必须更改代码以使用ScriptBundle相反。现在很好。不,我必须更改代码以使用ScriptBundle。现在很好。