从静态服务器向AjaxControlToolKitScriptManager提供脚本引用

时间:2014-08-20 05:57:28

标签: asp.net-web-api telerik ajaxcontroltoolkit

我将引用的文件保存在静态服务器上的bundle中,并希望引用AjaxControlToolKitScriptManager进行脚本引用。它不起作用。还有其他出路吗?下面是我试图实现的代码。浏览器能够下载文件但是telerik控件无法访问它

public void IncludeBundleFiles(BundleCollection bundles)
    {

bundles.Add(new ScriptBundle("~/JavaScript/TelerikListMaster").Include(
            "~/JavaScript/Telerik/Core.js",
            "~/JavaScript/Telerik/Ajax.js",
            "~/JavaScript/Telerik/jQuery.js",
            "~/JavaScript/Telerik/jQueryPlugins.js",
            "~/JavaScript/Telerik/RadGridScripts.js",
            "~/JavaScript/Telerik/GridCellSelection.js",
            "~/JavaScript/Telerik/OverlayScript.js",
            "~/JavaScript/Telerik/NavigationScripts.js",
            "~/JavaScript/Telerik/AnimationScripts.js",
            "~/JavaScript/Telerik/RadComboBoxScripts.js",
               "~/JavaScript/Telerik/TouchScrollExtender.js",
            "~/JavaScript/Telerik/RadMenuScripts.js",
            "~/JavaScript/Telerik/RadContextMenuScripts.js",
            "~/JavaScript/Telerik/RadFilterScripts.js",
            "~/JavaScript/Telerik/RadMenuItem.js",
            "~/JavaScript/Telerik/RadAutoCompleteBoxScripts.js",
            "~/JavaScript/Telerik/PopUpScripts.js",
            "~/JavaScript/Telerik/RadToolTipScripts.js",
            "~/JavaScript/Telerik/RadToolTipManager.js",
            "~/JavaScript/Telerik/RadInputScript.js",
            "~/JavaScript/Telerik/RadNumericInputScript.js",
            "~/JavaScript/Telerik/RadCalendarCommonScript.js",
            "~/JavaScript/Telerik/RadCalendarScript.js",
            "~/JavaScript/Telerik/RadDatePicker.js",
            "~/JavaScript/Telerik/RadPickersPopupDirectionEnumeration.js",
            "~/JavaScript/Telerik/RadInputManagerScript.js"));
}

<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server" CombineScripts="true" ScriptMode="Release">
            <CompositeScript Path="https://localhost/JavaScript/TelerikListMaster">
                <Scripts>

                </Scripts>
            </CompositeScript>
        </asp:ToolkitScriptManager>

1 个答案:

答案 0 :(得分:0)

我们需要放置脚本的引用以从复合标记下的静态服务器获取,并将所有脚本的组合脚本放在静态服务器上。有关详细信息,请参阅此文章。here

<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"     CombineScripts="true" ScriptMode="Release">
        <CompositeScript Path="https://localhost/StaticServer/JavaScript/TelerikListMaster.js">
            <Scripts>
                  <asp:ScriptReference Path="~/Scripts/Telerik/Common/Core.js" ScriptMode="Release" />
                    <asp:ScriptReference Path="~/Scripts/Telerik/TextBox/RadInputScript.js" ScriptMode="Release" />
                    <asp:ScriptReference Path="~/Scripts/Telerik/NumericTextBox/RadNumericInputScript.js" ScriptMode="Release" />
                    <asp:ScriptReference Path="~/Scripts/Telerik/Common/jQuery.js" ScriptMode="Release" />
                    <asp:ScriptReference Path="~/Scripts/Telerik/Navigation/OData.js" ScriptMode="Release" />
                    <asp:ScriptReference Path="~/Scripts/Telerik/Common/jQueryPlugins.js" ScriptMode="Release" />
                    <asp:ScriptReference Path="~/Scripts/Telerik/Common/TouchScrollExtender.js" ScriptMode="Release" />
                    <asp:ScriptReference Path="~/Scripts/Telerik/Navigation/OverlayScript.js" ScriptMode="Release" />
                    <asp:ScriptReference Path="~/Scripts/Telerik/Navigation/NavigationScripts.js" ScriptMode="Release" />
                    <asp:ScriptReference Path="~/Scripts/Telerik/ComboBox/RadComboBoxScripts.js" ScriptMode="Release" />
                    <asp:ScriptReference Path="~/Scripts/Telerik/ComboBox/View/ClassicView.js" ScriptMode="Release" />
                    <asp:ScriptReference Path="~/Scripts/Telerik/RadGrid/RadGridScripts.js" ScriptMode="Release" />
                    <asp:ScriptReference Path="~/Scripts/Telerik/Calendar/RadDatePicker.js" ScriptMode="Release" />
                    <asp:ScriptReference Path="~/Scripts/Telerik/Calendar/RadPickersPopupDirectionEnumeration.js" ScriptMode="Release" />
                    <asp:ScriptReference Path="~/Scripts/Telerik/DateInput/RadDateInputScript.js" ScriptMode="Release" />
                    <asp:ScriptReference Path="~/Scripts/Telerik/Common/Scrolling/ScrollingScripts.js" ScriptMode="Release" />
                    <asp:ScriptReference Path="~/Scripts/Telerik/Animation/AnimationScripts.js" ScriptMode="Release" />
                    <asp:ScriptReference Path="~/Scripts/Telerik/Menu/RadMenuScripts.js" ScriptMode="Release" />
                    <asp:ScriptReference Path="~/Scripts/Telerik/Menu/ContextMenu/RadContextMenuScripts.js" ScriptMode="Release" />
                    <asp:ScriptReference Path="~/Scripts/Telerik/Menu/MenuItem/RadMenuItem.js" ScriptMode="Release" />
                    <asp:ScriptReference Path="~/Scripts/Telerik/Menu/View/ClassicView.js" ScriptMode="Release" />
                    <asp:ScriptReference Path="~/Scripts/Telerik/Calendar/RadCalendarScript.js" ScriptMode="Release" />
                    <asp:ScriptReference Path="~/Scripts/Telerik/Calendar/RadCalendarCommonScript.js" ScriptMode="Release" />
            </Scripts>
        </CompositeScript>
    </asp:ToolkitScriptManager>