使用scriptmanager在asp.net上使用CDN

时间:2013-01-07 18:52:04

标签: asp.net cdn

在阅读asp.net cdn网站时,我阅读了以下内容

使用ASP.NET 4时,您可以将对ASP.NET框架脚本的所有请求重定向到CDN。从CDN而不是本地Web服务器检索脚本可以显着提高公共ASP.NET网站的性能。

使用ScriptManager EnableCDN属性将所有ASP.NET框架脚本请求重定向到Microsoft Ajax CDN:

<asp:ScriptManager ID="ScriptManager1" EnableCdn="true" Runat="Server" />

这是否意味着在asp.net网站模板上删除了在母版页上创建的脚本管理器,包括其下的脚本?

例如,我们要删除它吗?

<asp:ScriptManager runat="server" >
    <Scripts>
        <%--Framework scripts--%>
        <asp:ScriptReference Name="MsAjaxBundle" />
        <asp:ScriptReference Name="jquery" />
        <asp:ScriptReference Name="jquery.ui.combined" />
        <asp:ScriptReference Name="WebForms.js" Assembly="System.Web" Path="~/Scripts/WebForms/WebForms.js" />
        <asp:ScriptReference Name="WebUIValidation.js" Assembly="System.Web" Path="~/Scripts/WebForms/WebUIValidation.js" />
        <asp:ScriptReference Name="MenuStandards.js" Assembly="System.Web" Path="~/Scripts/WebForms/MenuStandards.js" />
        <asp:ScriptReference Name="GridView.js" Assembly="System.Web" Path="~/Scripts/WebForms/GridView.js" />
        <asp:ScriptReference Name="DetailsView.js" Assembly="System.Web" Path="~/Scripts/WebForms/DetailsView.js" />
        <asp:ScriptReference Name="TreeView.js" Assembly="System.Web" Path="~/Scripts/WebForms/TreeView.js" />
        <asp:ScriptReference Name="WebParts.js" Assembly="System.Web" Path="~/Scripts/WebForms/WebParts.js" />
        <asp:ScriptReference Name="Focus.js" Assembly="System.Web" Path="~/Scripts/WebForms/Focus.js" />
        <asp:ScriptReference Name="WebFormsBundle" />
        <%--Site scripts--%>
    </Scripts>
</asp:ScriptManager>

并将其替换为;

<asp:ScriptManager ID="ScriptManager1" EnableCdn="true" Runat="Server" />

CDN现在会提供我们请求的所有文件,包括jquery及其子集和ajax控件工具包文件吗?

0 个答案:

没有答案