Whats the replacement for @Scripts.Render in MVC 6

后端 未结 3 1323
花落未央
花落未央 2020-12-17 09:26

I am trying to run some d3js on my MVC 6 and was looking at this example https://github.com/DustinEwers/D3-DotNetMVC-Demos/blob/master/D3Demos/Views/TagDemos/BasicBarChart.c

3条回答
  •  暖寄归人
    2020-12-17 09:51

    If you just wan't to run that script, simply create a html script tag:

    
    

    But i really recommend that you bundle and minify your asset files. You can bundle, minify, move (and a lot more) your javascript/css files with the help of taskrunners like Gulp and Grunt.

    Information on how to use gulp can be found here: http://rudiv.se/Article/asp-net-5-bundling-with-bower-and-gulp

    And then with the help of Shyju post load correct files when you run your development or staging environment.

提交回复
热议问题