Quantcast
Channel: AjaxControlToolkit Work Item Rss Feed
Viewing all articles
Browse latest Browse all 4356

Created Unassigned: Using the CDN over https [28025]

$
0
0
When using the control toolkit with bundling and the CDN, the file is downloaded via http, even if the main site uses https.
This request is then blocked by the browser, and the script bundle fails to load.


This happens after using the AjaxControlToolkit.StaticResources NuGet package, and setting BundleTable.Bundles.UseCdn to true, as described on the Wiki here:
https://ajaxcontroltoolkit.codeplex.com/wikipage?title=How%20to%20use%20bundling%20and%20CDN

As a workaround, in global.asax.cs, I have added the code below.
However, that might not help if you have a mixed mode site.

Is there a better way to do this?

```
var ajaxControlToolkitBundle = BundleTable.Bundles.First(b => b.CdnPath.EndsWith("AjaxControlToolkit/Bundle.js"));
ajaxControlToolkitBundle.CdnPath = ajaxControlToolkitBundle.CdnPath.Replace("http:", "https:");

BundleTable.Bundles.UseCdn = true;
```

Viewing all articles
Browse latest Browse all 4356

Trending Articles