This is a migrated thread and some comments may be shown as answers.

[Solved] Programmatically enable/disable CDN

2 Answers 242 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
mlandauer
Top achievements
Rank 1
mlandauer asked on 05 Feb 2010, 09:29 PM
My site is both used internally by our company (intranet) and externally by our clients (internet).  I would like to use the Telerik CDN, but disable it for our intranet users.  Is there a way to programmatically enable/disable CDN on the RadScriptManager and RadStyleSheetManager?

2 Answers, 1 is accepted

Sort by
0
Accepted
T. Tsonev
Telerik team
answered on 08 Feb 2010, 03:41 PM
Hello,

You can do so by using a base class or a master page. For example:
protected override void OnInit(EventArgs e)
{
    base.OnInit(e);
 
    var scriptMgr = RadScriptManager.GetCurrent(this) as RadScriptManager;
    if (scriptMgr != null)
    {
        scriptMgr.CdnSettings.TelerikCdn = TelerikCdnMode.Enabled
    }
     
    var stylesheetMgr = RadStyleSheetManager.GetCurrent(this);
    if (stylesheetMgr != null)
    {
        stylesheetMgr.CdnSettings.TelerikCdn = TelerikCdnMode.Enabled;
    }
}

I hope this helps.

Best wishes,
Tsvetomir Tsonev
the Telerik team

Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Follow the status of features or bugs in PITS and vote for them to affect their priority.
0
mlandauer
Top achievements
Rank 1
answered on 08 Feb 2010, 08:37 PM
Thanks... that's what I was looking for.
Tags
General Discussions
Asked by
mlandauer
Top achievements
Rank 1
Answers by
T. Tsonev
Telerik team
mlandauer
Top achievements
Rank 1
Share this question
or