Adding to script bundle from partial view in .NET MVC 5

后端 未结 3 1718
悲&欢浪女
悲&欢浪女 2020-12-15 01:39

We are making a .Net MVC websolution that is going to be using widgets rendered as HTML.Partials(). We would like to be able for the partial view to add its dependencys in t

3条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-15 02:08

    @The Kaizer, For you own answer above. In Widget.cshtml you might want to use

    var bundle = System.Web.Optimization.BundleTable.Bundles.GetBundleFor("~/widgetspecific");
    

提交回复
热议问题