Whats the replacement for @Scripts.Render in MVC 6

后端 未结 3 1321
花落未央
花落未央 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:42

    It's a bit more complicated now, but the documentation explains it quite well:

    The ASP.NET MVC 5 starter web template utilized ASP.NET’s built-in support for bundling. In ASP.NET MVC 6, this functionality is better performed using client build steps...

    So to bundle scripts together you can use a tool like gulp-concat. And to include a script, just add it in the way you would if it were static content:

    
    

    For a more complete example of including content, the answer by @Shyju is excellent.

提交回复
热议问题