Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Script Resource Mappings Not Loading From CDN

Script Resource Mappings Not Loading From CDN

Scheduled Pinned Locked Moved ASP.NET
javascriptcomdesignhostingtools
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Dominick Marciano
    wrote on last edited by
    #1

    I am using a script manager in one of my master pages in order to load several libraries: jQuery, jQuery UI, and Moment. I set up the mappings in the MapJsLibraries method that is called by the Application_Start method in Global.asax:

    Private Sub MapJsLibraries()
        With ScriptManager.ScriptResourceMapping
    
            .AddDefinition("jQuery", Nothing, New ScriptResourceDefinition With {.Path = "~/scripts/jquery-2.1.3.min.js",
                                                                        .DebugPath = "~/scripts/jquery-2.1.3.js",
                                                                        .CdnPath = "https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js",
                                                                        .CdnDebugPath = "https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.js",
                                                                        .CdnSupportsSecureConnection = True})
            .AddDefinition("jQueryUI", Nothing, New ScriptResourceDefinition With {.Path = "~/scripts/jquery-ui-1.11.3.min.js",
                                                                         .DebugPath = "~/scripts/jquery-ui-1.11.3.js",
                                                                         .CdnPath = "https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js",
                                                                         .CdnDebugPath = "https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.2/jquery-ui.js",
                                                                         .CdnSupportsSecureConnection = True})
            .AddDefinition("Moment", Nothing, New ScriptResourceDefinition With {.Path = "~/scripts/moment-2.9.0.min.js",
                                                                         .DebugPath = "~/scripts/moment-2.9.0.js",
                                                                         .CdnPath = "https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.9.0/moment.min.js",
                                                                         .CdnDebugPath = "https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.9.0/moment.js",
                                                                         .CdnSupportsSecureConnection = True})
        End With
    End Sub
    

    In my master page I have the script manager control:

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups