views:

10

answers:

1

I want to use the Microsoft's CDN for hosting the AJAX Library for my .NET 4.0 web application. However, I was asked to implement a fallback for when the CDN isn't available or when developers want to develop locally without internet. In these scenarios the ScriptManager should send the locally hosted copies rather than the CDN copies of the JavaScript. I know I can manually disable the CDN in the scriptmanager, but this can be tedious and potentially lead to missed configurations reaching production.

Is there a more elegant way to use a local copy of the JavaScript files without manually disabling CDN in every spot in code via ScriptManager?

A: 

Taken from html5 boiler plate

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.js"></script>
<script>!window.jQuery && document.write(unescape('%3Cscript src="js/libs/jquery-1.4.2.js"%3E%3C/script%3E'))</script>
Alistair
Thanks for the tip, however I can do this easily outside of the ScriptManager. I was hoping for an answer more geared towards the .NET ScriptManager control.
sgmeyer