/// <summary> /// Called by components that use jQuery UI to add the basic jQuery UI JavaScript/CSS to the page. /// </summary> public static async Task UseAsync() { if (Manager.IsPostRequest) { return; // can't add this while processing a post request } CoreRendering.ComponentsData cData = CoreRendering.GetComponentsData(); if (!cData.JqueryUIUsed) { cData.JqueryUIUsed = true; await Manager.AddOnManager.AddAddOnNamedAsync(AreaRegistration.CurrentPackage.AreaName, "jqueryui"); // Find the jquery theme+ SkinAccess skinAccess = new SkinAccess(); string skin = Manager.CurrentPage.jQueryUISkin; if (string.IsNullOrWhiteSpace(skin)) { skin = Manager.CurrentSite.jQueryUISkin; } string jqueryUIFolder = await skinAccess.FindJQueryUISkinAsync(skin); await Manager.AddOnManager.AddAddOnNamedAsync(AreaRegistration.CurrentPackage.AreaName, "jqueryui-themes", jqueryUIFolder); Manager.ScriptManager.AddVolatileOption(AreaRegistration.CurrentPackage.AreaName, "jqueryUI", true, Replace: true); } }
/// <summary> /// Adds any skin-specific addons for the current page that are required by the package rendering components and views. /// </summary> public async Task AddSkinAddOnsAsync() { SkinAccess skinAccess = new SkinAccess(); string skin; // add jqueryui theme folder in case we need to dynamically load jqueryui from the client // Find the jquery theme+ skin = Manager.CurrentPage.jQueryUISkin; if (string.IsNullOrWhiteSpace(skin)) { skin = Manager.CurrentSite.jQueryUISkin; } string jqueryUIFolder = await skinAccess.FindJQueryUISkinAsync(skin); Manager.ScriptManager.AddVolatileOption(AreaRegistration.CurrentPackage.AreaName, "jqueryUITheme", jqueryUIFolder); // add kendoui theme folder in case we need to dynamically load kendoui from the client // Find the kendo theme skinAccess = new SkinAccess(); skin = Manager.CurrentPage.KendoUISkin; if (string.IsNullOrWhiteSpace(skin)) { skin = Manager.CurrentSite.KendoUISkin; } string kendoUITheme = await skinAccess.FindKendoUISkinAsync(skin); Manager.ScriptManager.AddVolatileOption(AreaRegistration.CurrentPackage.AreaName, "kendoUITheme", kendoUITheme); }