[英]@Scripts.Render() <script> tag links to a Html source code page, and scripts are not detected
Here is where i include the ScriptBundle:这是我包含 ScriptBundle 的地方:
bundles.Add(new ScriptBundle("~/scripts").Include(
"~/Scripts/jquery.js", "~/Scripts/popper.js",
"~/Scripts/bootstrap.js", "~/Scripts/Index.js"));
When i debbug the application the script tags are rendered separately, and it works well.当我调试应用程序时,脚本标签是单独呈现的,并且运行良好。 The problem is when i publish the project, the scripts are rendered in a single tag;
问题是当我发布项目时,脚本呈现在单个标签中; i know that AspNet compress all the scripts in a single tag, but the web page does not detect the scripts and when i click on the link of the rendered tag, it directs me to a source code page (HTML) in which the scripts should be.
我知道 AspNet 将所有脚本压缩在一个标签中,但是网页没有检测到脚本,当我点击呈现标签的链接时,它会将我定向到一个源代码页 (HTML),脚本应该在其中是。
This is the tag:这是标签:
<script src="/scripts?v=r8NL2JoYrRk4WG4L8aUu1037yymdncGQgFxOAcbEyw41"></script>
And this is the link: script_tag_link这是链接: script_tag_link
Here is how the page of the link looks: Here should be the compressed scripts以下是链接页面的外观:这里应该是压缩脚本
The ScriptBundle name, in this case "~/scripts", shouldn't match an existing folder in your application. ScriptBundle 名称(在本例中为“~/scripts”)不应与应用程序中的现有文件夹匹配。 Try changing it to "~/bundles".
尝试将其更改为“~/bundles”。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.