简体   繁体   中英

Using System.Web.Optimization Bundling, How Can I access The Result of a Built Bundle?

I need to write some bundled CSS to the page, but can figure out how to get the actual content of a StyleBundle to do that. Is there an (easy) way?

Presuming you have a bundle set up like so: bundles.Add(new StyleBundle("~/Content/css").Include("~/Content/site.css"));

In your CSHTML file, do the following: @Styles.Render("~/Content/css")

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM