Adding external URLs

In addition to local files, you can define bundles based on external URLs. Cassette won't process these bundles, however the URLs are used when rendering the HTML.


Then another script can reference this bundle.

/// <reference path=""/>
$(function() {

However, it can be easier to define an alias for the bundle.


Then the reference can use the alias instead.

/// <reference path="~/jquery"/>
$(function() {

URL with local fallback assets

If a remote URL fails to load you can fallback to using a local bundle.

    new LocalAssetSettings
        FallbackCondition = "!window.jQuery",
        Path = "scripts/jquery.js"

This will generate the following HTML.

<script src="//" type="text/javascript"></script>
<script type="text/javascript">
    if (!window.jQuery) {
        document.write(unescape('%3Cscript src="/cassette.axd/script/PlxtfG4Jll0234wePZ3KZGLEHsE=/scripts/jquery.js" type="text/javascript"%3E%3C/script%3E'));

Note that this feature will only be activated if debug mode is off (see web-config)