Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Mixing bundles and regular script?
Message
 
 
À
29/10/2012 04:09:51
Information générale
Forum:
ASP.NET
Catégorie:
MVC
Versions des environnements
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01555909
Message ID:
01555995
Vues:
32
>>>>In other words, this compiles, but I am not sure if this is correct usage:
>>>>
>>>>
>>>> bundles.Add(new ScriptBundle("~/bundles/jquery.dataTables").Include("http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.8.2.min.js","http://ajax.aspnetcdn.com/ajax/jquery.dataTables/1.9.4/jquery.dataTables.min.js"));
>>>>
>>>>
>>>>UPDATE. Working through this blog post now http://www.tomdupont.net/2012/03/configuring-bundles-in-mvc-4.html
>>>>So far I managed to break the already working page, but hopefully will succeed at the end.
>>>>Thanks in advance.
>>>
>>>I think you can use BundleCollection.UseCdn which also allows for fallback if the CDN is not available.
>>>See 'Using a CDN' here: http://www.asp.net/mvc/tutorials/mvc-4/bundling-and-minification
>>
>>Is there a way to specify directory for all jquery, instead of providing cdn path for each individual jquery file?
>>
>>Say, in the bundles.config I have
>>
>><jsBundles>
>>    <add bundlePath="~/js/shared" minify ="true">
>>      <directories>
>>        <add directoryPath="~/scripts/jQuery/" searchPattern="*.js"></add>
>>        <add directoryPath="~/scripts/" searchPattern="*.js"></add>
>>      </directories>
>>      <!--
>>      <files>
>>        <add filePath="~/scripts/jscript1.js"></add>
>>        <add filePath="~/scripts/jscript2.js"></add>
>>      </files>
>>      -->
>>    </add>
>>  </jsBundles>
>>
>>and I want to be able to add cdnPath for al jquery files.
>
>Doesn't look like it :-{
>The whole of the MS documentation for System.Web.Optimization namespace (http://msdn.microsoft.com/en-us/library/system.web.optimization) seems pretty flaky. The 'UseCdn' property on BundleCollection is not mentioned ; neither are half of the Bundle class constructors so it's impossible (except by trial) to know how this is handled.....

I don't understand why none of the CDN directories can be accessed directly and only individual files can be accessed. In this case, how can I reference them?

Say, http://www.asp.net/ajaxlibrary/CDNjQueryUI190.ashx - each theme is a separate file. So, what am I supposed to do?
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform