本文整理汇总了C#中BundleCollection.AddUrlWithLocalAssets方法的典型用法代码示例。如果您正苦于以下问题:C# BundleCollection.AddUrlWithLocalAssets方法的具体用法?C# BundleCollection.AddUrlWithLocalAssets怎么用?C# BundleCollection.AddUrlWithLocalAssets使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BundleCollection
的用法示例。
在下文中一共展示了BundleCollection.AddUrlWithLocalAssets方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Configure
public void Configure(BundleCollection bundles, CassetteSettings settings)
{
bundles.Add<StylesheetBundle>("assets/styles");
bundles.Add<StylesheetBundle>("assets/iestyles", b => b.Condition = "IE 9");
bundles.AddUrlWithLocalAssets("//ajax.googleapis.com/ajax/libs/jquery/1.6.3/jquery.min.js", new LocalAssetSettings
{
Path = "~/assets/scripts/jquery",
FallbackCondition = "!window.jQuery"
});
bundles.AddPerSubDirectory<ScriptBundle>("assets/scripts");
}
示例2: Configure
public void Configure(BundleCollection bundles, CassetteSettings settings)
{
bundles.Add<StylesheetBundle>("assets/styles");
bundles.Add<StylesheetBundle>("assets/iestyles", b => b.Condition = "IE");
bundles.AddPerSubDirectory<ScriptBundle>("assets/scripts");
bundles.AddUrlWithLocalAssets(
"//ajax.googleapis.com/ajax/libs/jquery/1.6.3/jquery.min.js",
new LocalAssetSettings
{
FallbackCondition = "!window.jQuery",
Path = "assets/scripts/jquery"
}
);
var pluginScripts = new ScriptBundle("plugin/scripts");
pluginScripts.Processor = new ScriptPipeline();
pluginScripts.Assets.Add(new ResourceAsset("assets/scripts/plugin/script1.js", GetType().Assembly, pluginScripts));
pluginScripts.Assets.Add(new ResourceAsset("assets/scripts/plugin/script2.js", GetType().Assembly, pluginScripts));
pluginScripts.Assets.Add(new ResourceAsset("assets/scripts/plugin/script3.js", GetType().Assembly, pluginScripts));
bundles.Add(pluginScripts);
}
示例3: Configure
public void Configure(BundleCollection bundles, CassetteSettings settings)
{
bundles.Add<StylesheetBundle>("Content");
bundles.Add<ScriptBundle>("Scripts", new FileSearch { SearchOption = SearchOption.TopDirectoryOnly });
bundles.AddPerIndividualFile<ScriptBundle>("Scripts/Pages");
bundles.AddUrlWithLocalAssets(
"http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.1.min.js",
new LocalAssetSettings
{
Path = "Scripts/CDN/jquery-1.7.1.js",
FallbackCondition = "!window.jQuery"
}
);
bundles.AddUrlWithLocalAssets(
"http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.17/jquery-ui.min.js",
new LocalAssetSettings
{
Path = "Scripts/CDN/jquery-ui-1.8.17.js",
FallbackCondition = "!window.jQuery.ui"
}
);
bundles.AddUrlWithAlias(
"http://ajax.aspnetcdn.com/ajax/jquery.validate/1.9/jquery.validate.min.js",
"jquery.validate"
//new LocalAssetSettings
//{
// Path = "Scripts/CDN/jquery.validate-1.9.js",
// FallbackCondition = "!window.jQuery.fn.validate"
//}
);
bundles.AddUrlWithAlias(
"http://ajax.aspnetcdn.com/ajax/jquery.mobile/1.0/jquery.mobile-1.0.min.js",
"jquery.mobile"
//new LocalAssetSettings
//{
// Path = "Scripts/CDN/jquery.mobile-1.0.js",
// FallbackCondition = "!window.jQuery"
//}
);
bundles.AddUrlWithAlias(
"http://ajax.aspnetcdn.com/ajax/mvc/3.0/jquery.unobtrusive-ajax.min.js",
"jquery.unobtrusive-ajax"
//new LocalAssetSettings
//{
// Path = "Scripts/CDN/jquery.unobtrusive-ajax.js",
// FallbackCondition = "!window.jQuery"
//}
);
bundles.AddUrlWithAlias(
"http://ajax.aspnetcdn.com/ajax/mvc/3.0/jquery.validate.unobtrusive.min.js",
"jquery.validate.unobtrusive"
//new LocalAssetSettings
//{
// Path = "Scripts/CDN/jquery.validate.unobtrusive.js",
// FallbackCondition = "!window.jQuery"
//}
);
// bundles.AddUrlWithLocalAssets(
// "http://ajax.aspnetcdn.com/ajax/mvc/3.0/MicrosoftMvcAjax.debug.js",
// new LocalAssetSettings
// {
// Path = "Scripts/CDN/MicrosoftMvcAjax.js",
// FallbackCondition = "!window.jQuery"
// }
//);
}