Is this exactly what you are looking for? The code below simply gets the theme configuration parameter value:
public static void RegisterBundles(BundleCollection bundles) { bundles.Add(new StyleBundle("/~Content/css"). Include(String.Format("~/Content/{0}/site.css", ConfigurationManager.AppSettings("theme")))); }
In your opinion, just call Styles.Render :
@Styles.Render("~/Content/css");
If you need to use values ββother than configuration parameters, I think you will need a static method that returns the corresponding value.
source share