1

In MVC4 you can render CSS stles by using

Styles.Render(path here)

Similarly scripts can be rendered by

Scripts.Render(path here)

But how do render XSL/XSLT stylesheets? Will Styles.Render do the trick?

Flood Gravemind
  • 3,773
  • 12
  • 47
  • 79

1 Answers1

0

The reason you do @Styles.Render or @Scripts.Render is because it references a bundle created somewhere in Global.asax, usually in the BundleConfig (look in your App_Start folder). They are created using the code

bundles.Add(new StyleBundle("~/Content/themes/base/css").Include(
                    "~/Content/themes/base/jquery.ui.core.css",
                    "~/Content/themes/base/jquery.ui.resizable.css"...

so then you can use them in your views as @Styles.Render("~/Content/themes/base/css"). The framework actually creates a virtual file with the path "~/Content/themes/base/css" to enable this bundling technology.

I dont think the stylebundle can be used with xsl/xslt stylesheets, although I dont know for sure. Here are some relevant question to boot.

How to apply an XSLT Stylesheet in C#

or any of these really

https://stackoverflow.com/questions/tagged/xslt+asp.net-mvc

Community
  • 1
  • 1
monkeyhouse
  • 2,875
  • 3
  • 27
  • 42