<i id='8RBP8'><tr id='8RBP8'><dt id='8RBP8'><q id='8RBP8'><span id='8RBP8'><b id='8RBP8'><form id='8RBP8'><ins id='8RBP8'></ins><ul id='8RBP8'></ul><sub id='8RBP8'></sub></form><legend id='8RBP8'></legend><bdo id='8RBP8'><pre id='8RBP8'><center id='8RBP8'></center></pre></bdo></b><th id='8RBP8'></th></span></q></dt></tr></i><div id='8RBP8'><tfoot id='8RBP8'></tfoot><dl id='8RBP8'><fieldset id='8RBP8'></fieldset></dl></div>
        <tfoot id='8RBP8'></tfoot>

        <legend id='8RBP8'><style id='8RBP8'><dir id='8RBP8'><q id='8RBP8'></q></dir></style></legend>
          <bdo id='8RBP8'></bdo><ul id='8RBP8'></ul>
      1. <small id='8RBP8'></small><noframes id='8RBP8'>

        如何在 ASP.net Core 中添加 js 和 css 文件?

        How to add js and css files in ASP.net Core?(如何在 ASP.net Core 中添加 js 和 css 文件?)

        <small id='pDfEu'></small><noframes id='pDfEu'>

          <bdo id='pDfEu'></bdo><ul id='pDfEu'></ul>
          <tfoot id='pDfEu'></tfoot>
        • <i id='pDfEu'><tr id='pDfEu'><dt id='pDfEu'><q id='pDfEu'><span id='pDfEu'><b id='pDfEu'><form id='pDfEu'><ins id='pDfEu'></ins><ul id='pDfEu'></ul><sub id='pDfEu'></sub></form><legend id='pDfEu'></legend><bdo id='pDfEu'><pre id='pDfEu'><center id='pDfEu'></center></pre></bdo></b><th id='pDfEu'></th></span></q></dt></tr></i><div id='pDfEu'><tfoot id='pDfEu'></tfoot><dl id='pDfEu'><fieldset id='pDfEu'></fieldset></dl></div>

              <tbody id='pDfEu'></tbody>
            <legend id='pDfEu'><style id='pDfEu'><dir id='pDfEu'><q id='pDfEu'></q></dir></style></legend>
                  本文介绍了如何在 ASP.net Core 中添加 js 和 css 文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我被分配将应用程序从 MVC 迁移到 ASP.net Core,我是 ASP.net Core 的新手.在 MVC 中,我们有 BundleConfig.cs 并在其中添加对 css 和 js 文件的引用,它在 ASP.net Core 中是如何工作的?假设我创建了一个 test.js 和一个 MyStyle.css 类,这是在每个视图中添加对它的引用的最佳方式吗?我应该将 .js.css 文件放在 wwwroot/jswwwroot/css 中吗?

                  I've been assigned to migrate an application from MVC into ASP.net Core, I'm new to ASP.net Core. In MVC we have BundleConfig.cs and in there we add references to our css and js files, how does it work in ASP.net Core? Let's say that I created a test.js and a MyStyle.css class, which is the best way to add references to it in every view? Should I place the .js and .css files inside wwwroot/js and wwwroot/css?

                  推荐答案

                  我在 _Layout 视图中添加了引用,在 <environment> 标签内:p>

                  I added the references inside the _Layout view, inside the <environment> tags:

                  <environment names="Development">
                    <link rel="stylesheet" href="~/css/MyCss.css" />
                  </environment>
                  

                  如果有人知道更好的方法,我会欢迎它

                  If anyone knows a better way I would welcome it

                  这篇关于如何在 ASP.net Core 中添加 js 和 css 文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Multicast delegate weird behavior in C#?(C# 中的多播委托奇怪行为?)
                  Parameter count mismatch with Invoke?(参数计数与调用不匹配?)
                  How to store delegates in a List(如何将代表存储在列表中)
                  How delegates work (in the background)?(代表如何工作(在后台)?)
                  C# Asynchronous call without EndInvoke?(没有 EndInvoke 的 C# 异步调用?)
                  Delegate.CreateDelegate() and generics: Error binding to target method(Delegate.CreateDelegate() 和泛型:错误绑定到目标方法)

                        <tbody id='Q0Hxe'></tbody>
                      <legend id='Q0Hxe'><style id='Q0Hxe'><dir id='Q0Hxe'><q id='Q0Hxe'></q></dir></style></legend>
                        <tfoot id='Q0Hxe'></tfoot>

                      1. <i id='Q0Hxe'><tr id='Q0Hxe'><dt id='Q0Hxe'><q id='Q0Hxe'><span id='Q0Hxe'><b id='Q0Hxe'><form id='Q0Hxe'><ins id='Q0Hxe'></ins><ul id='Q0Hxe'></ul><sub id='Q0Hxe'></sub></form><legend id='Q0Hxe'></legend><bdo id='Q0Hxe'><pre id='Q0Hxe'><center id='Q0Hxe'></center></pre></bdo></b><th id='Q0Hxe'></th></span></q></dt></tr></i><div id='Q0Hxe'><tfoot id='Q0Hxe'></tfoot><dl id='Q0Hxe'><fieldset id='Q0Hxe'></fieldset></dl></div>

                          <small id='Q0Hxe'></small><noframes id='Q0Hxe'>

                          • <bdo id='Q0Hxe'></bdo><ul id='Q0Hxe'></ul>