コード例 #1
0
        /// <summary>
        /// Adds a named Kendo UI Core file.
        /// </summary>
        /// <param name="file">The name of the Kendo UI file to add.</param>
        public static async Task AddFileAsync(string file)
        {
            if (Manager.IsPostRequest)
            {
                return;                       // can't add this while processing a post request
            }
            await UseAsync();

            if (Manager.CurrentSite.CanUseCDNComponents)
            {
                return;                                         // already included
            }
            if (_kendoAddon == null)
            {
                _kendoAddon = VersionManager.FindAddOnNamedVersion(AreaRegistration.CurrentPackage.AreaName, "telerik.com.Kendo_UI_Core");
            }
            string productJsUrl = _kendoAddon.GetAddOnJsUrl();
            string url          = productJsUrl + file;
            await Manager.ScriptManager.AddAsync(url);
        }