DevExpress / AjaxControlToolkit

The ASP.NET AJAX Control Toolkit is a classic set of ASP.NET WebForms extensions.
https://devexpress.com/act
BSD 3-Clause "New" or "Revised" License
290 stars 136 forks source link

CDN Does Not Work When Deployed to IIS #565

Open PostAlmostAnything opened 3 years ago

PostAlmostAnything commented 3 years ago

I have a ScriptManager configured to use the CDN. It works great for everything except the AJAX toolkit remotely. If I load the site on my local machine all the AJAX scripts run off the CDN like they should, but when I upload it to my remote server I see no references to the CDN for AJAX and a bunch of references to ScriptResource.axd. What could cause the site not to use the CDN only on the remote host?

Here is the Script Manager

<%--To learn more about bundling scripts in ScriptManager see http://go.microsoft.com/fwlink/?LinkID=301884 --%> <%--Framework Scripts--%> <%--Site Scripts--%> Here is the BundleConfig.cs file public class BundleConfig { // For more information on Bundling, visit http://go.microsoft.com/fwlink/?LinkID=303951 public static void RegisterBundles(BundleCollection bundles) { bundles.Add(new ScriptBundle("~/bundles/WebFormsJs").Include( "~/Scripts/WebForms/WebForms.js", "~/Scripts/WebForms/WebUIValidation.js", "~/Scripts/WebForms/MenuStandards.js", "~/Scripts/WebForms/Focus.js", "~/Scripts/WebForms/GridView.js", "~/Scripts/WebForms/DetailsView.js", "~/Scripts/WebForms/TreeView.js", "~/Scripts/WebForms/WebParts.js")); // Order is very important for these files to work, they have explicit dependencies bundles.Add(new ScriptBundle("~/bundles/MsAjaxJs").Include( "~/Scripts/WebForms/MsAjax/MicrosoftAjax.js", "~/Scripts/WebForms/MsAjax/MicrosoftAjaxApplicationServices.js", "~/Scripts/WebForms/MsAjax/MicrosoftAjaxTimer.js", "~/Scripts/WebForms/MsAjax/MicrosoftAjaxWebForms.js")); // Use the Development version of Modernizr to develop with and learn from. Then, when you’re // ready for production, use the build tool at http://modernizr.com to pick only the tests you need bundles.Add(new ScriptBundle("~/bundles/modernizr").Include( "~/Scripts/modernizr-*")); ScriptManager.ScriptResourceMapping.AddDefinition( "respond", new ScriptResourceDefinition { Path = "~/Scripts/respond.min.js", DebugPath = "~/Scripts/respond.js", CdnPath = "https://cdnjs.cloudflare.com/ajax/libs/respond.js/1.4.0/respond.min.js", CdnDebugPath = "https://cdnjs.cloudflare.com/ajax/libs/respond.js/1.4.0/respond.js", CdnSupportsSecureConnection = true }); ScriptManager.ScriptResourceMapping.AddDefinition( "popper", new ScriptResourceDefinition { Path = "~/Scripts/umd/popper.min.js", DebugPath = "~/Scripts/umd.popper.js", CdnPath = "https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.1/umd/popper.min.js", CdnDebugPath = "https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.1/umd/popper.js", CdnSupportsSecureConnection = true, }); ScriptManager.ScriptResourceMapping.AddDefinition( "lazysizes", new ScriptResourceDefinition { Path = "~/lib/lazysizes/lazysizes.min.js", DebugPath = "~/lib/lazysizes/lazysizes.js", CdnPath = "https://cdnjs.cloudflare.com/ajax/libs/lazysizes/5.2.2/lazysizes.min.js", CdnDebugPath = "https://cdnjs.cloudflare.com/ajax/libs/lazysizes/5.2.2/lazysizes.js", CdnSupportsSecureConnection = true, }); } } Here is the source code from a page running on my local machine WITHOUT SSL UPDATE: Seems the problem is solely with the AJAX Control Toolkit and Nothing else. I am guessing since my remote server supports SSL only and upgrades insecure request that has something to do with it..