MVC4 中的 Styles.Render [英] Styles.Render in MVC4
本文介绍了MVC4 中的 Styles.Render的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在 .NET MVC4
项目中 @Styles.Render
是如何工作的?
In a .NET MVC4
project how does @Styles.Render
works?
我的意思是,在 @Styles.Render("~/Content/css")
中调用的是哪个文件?
I mean, in @Styles.Render("~/Content/css")
which file is it calling?
我的 Content
文件夹中没有名为css"的文件或文件夹.
I dont have a file or a folder called "css" inside my Content
folder.
推荐答案
它调用包含在该特定包中的文件,该包在 App_Start
中的 BundleConfig
类中声明文件夹.
It's calling the files included in that particular bundle which is declared inside the BundleConfig
class in the App_Start
folder.
在这种特殊情况下,对 @Styles.Render("~/Content/css")
的调用正在调用~/Content/site.css".
In that particular case The call to @Styles.Render("~/Content/css")
is calling "~/Content/site.css".
bundles.Add(new StyleBundle("~/Content/css").Include("~/Content/site.css"));
这篇关于MVC4 中的 Styles.Render的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文