If the assembly does not specify the CDN path in its WebResourceAttributes attributes, EnableCDN will not know where to go. So here it is.
CDN, CDN, . , ACT CDN . , , 40412, , :
http://www.asp.net/ajaxlibrary/CDNACT40412.ashx
( ):
http://weblogs.asp.net/infinitiesloop/archive/2009/11/23/asp-net-4-0-scriptmanager-improvements.aspx
, :
void Application_Start(object sender, EventArgs e) {
ScriptManager.ScriptResourceMapping.AddDefinition("Foo.js", typeof(FooControl).Assembly, new ScriptResourceDefinition {
ResourceName = "Foo.js",
ResourceAssembly = typeof(FooControl).Assembly,
CdnPath = "http://yadda-yadda/foo.js",
CdnDebugPath = "http://yadda-yadda/foo.debug.js",
});
}
. , , Foo.dll. script "Foo.js" ( .js ). , asp: ScriptReferences ( ) ScriptResource.axd. WebResourceAttribute script CDN, , CdnMode.
, script. . script ( " ", ). AddDefinition .
, , , script. , , cdn.. .
ResourceName ResourceAssembly , script , . , CDN . : (1) , CDN, (2) , (foo.debug.js) LOCALIZED ( , foo.fr-FR.js) , CDN ( ). ( , , ).
CdnPath CdnDebugPath , . EnableCdn !
ScriptMapping, , script, . , script .
... AjaxControlToolkit?
script . , . script. 1 . , - , , , .
- 1 2 ACT, , . , .
, , , script ( " " )? , , System.Web.Extensions "AjaxFrameworkAssembly" . , , . "AjaxFrameworkAssembly" ? , System.Web.Extensions , "AjaxFrameworkAssembly" . , " , ms ajax, System.Web.Extensions". ACT , "" , System.Web.Extensions. , . , , , presto, , . , , . , , .
InfinitiesLoop. :)