J'ai ajouté des fichiers CSS bootstrap via un StyleBundle à mon projet asp.net mvc 5.asp.net mvc 5 - Questions StyleBundle CdnFallbackExpression?
(Il utilise comme CA: https://www.asp.net/ajax/cdn#Bootstrap_Releases_on_the_CDN_14)
var bootstrapCssCdnPath = "http://ajax.aspnetcdn.com/ajax/bootstrap/3.3.7/css/bootstrap.min.css";
var bootstrapCssBundle = new StyleBundle("~/bundles/css/bootstrap", bootstrapCssCdnPath).Include("~/Content/bootstrap.css");
//bootstrapCssBundle.CdnFallbackExpression // ?
bundles.Add(bootstrapCssBundle);
var bootstrapThemeCssCdnPath = "http://ajax.aspnetcdn.com/ajax/bootstrap/3.3.7/css/bootstrap-theme.min.css";
var bootstrapThemeCssBundle = new StyleBundle("~/bundles/css/bootstraptheme", bootstrapThemeCssCdnPath).Include("~/Content/bootstrap-theme.css");
//bootstrapCssBundle.CdnFallbackExpression // ?
bundles.Add(bootstrapThemeCssBundle);
Cependant, il y a un problème: quand j'ajoute une URL incorrecte comme CDN (par exemple en ajoutant 'ahttp' au lieu de 'http') mon habitude "fallback" Le fichier css n'est pas utilisé, mais il montre 'ahttp: //' dans ma source html. Même lorsque j'utilise mon site sur Debug ou Release.
- Pourquoi mon système de repli n'est-il pas utilisé?
- Qu'est-ce que CdnFallbackExpression pour un StyleBundle? (et en particulier pour un fichier bootstrap.css et un fichier bootstrap-theme.css)
- Le fichier .Intermine-t-il le fichier .min.css ou recherche-t-il automatiquement le fichier .min. version première?
- Existe-t-il un moyen de .Inclure plusieurs fichiers CSS, en utilisant un Cdn avec un système de secours, afin de ne pas avoir à créer un nouveau StyleBundle à chaque fois par fichier css utilisant un Cdn?