加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

c# – 如何将多个ScriptBundle捆绑到一个新的ScriptBundle中

发布时间:2020-12-15 21:43:19 所属栏目:百科 来源:网络整理
导读:这就是我到目前为止所做的 bundles.Add(new ScriptBundle("~/bundles/WebformsJS").Include( "~/Scripts/WebForms/WebForms.js","~/Scripts/WebForms/WebUIValidation.js","~/Scripts/WebForms/MenuStandards.js","~/Scripts/WebForms/Focus.js","~/Scripts/
这就是我到目前为止所做的

bundles.Add(new ScriptBundle("~/bundles/WebformsJS").Include(
      "~/Scripts/WebForms/WebForms.js","~/Scripts/WebForms/WebUIValidation.js","~/Scripts/WebForms/MenuStandards.js","~/Scripts/WebForms/Focus.js","~/Scripts/WebForms/GridView.js","~/Scripts/WebForms/DetailsView.js","~/Scripts/WebForms/TreeView.js","~/Scripts/WebForms/WebParts.js"));

bundles.Add(new ScriptBundle("~/bundles/MsAjaxJS").Include(
    "~/Scripts/WebForms/MsAjax/MicrosoftAjax.js","~/Scripts/WebForms/MsAjax/MicrosoftAjaxApplicationServices.js","~/Scripts/WebForms/MsAjax/MicrosoftAjaxTimer.js","~/Scripts/WebForms/MsAjax/MicrosoftAjaxWebForms.js"));


bundles.Add(new ScriptBundle("~/bundles/MegaJS").
    .Include("~/bundles/WebformsJS")
    .Include("~/bundles/MsAjaxJS"));

然后我在Site.Master文件中呈现MegaBundle,如下所示:

<%: Scripts.Render("~/bundles/MegaJS") %>

应用程序运行时没有错误,但是当我查看页面源时,我可以看到包含

<script src="/bundles/MegaJS?v="></script>

如果您发现版本为空白,并且我单击捆绑脚本时为空

My questions are:
1) Does creating bundle from other bundle’s is supported
2) If Yes! then is their an example I can follow.

解决方法

不,目前您不能在捆绑包中包含捆绑包,您只能包含实际资产.这是我们在资产管理的待办事项列表中所拥有的.如果这是你想要的功能 here,你可以投票.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读