This is a migrated thread and some comments may be shown as answers.

RadWindow & outputcache in control

1 Answer 26 Views
Window
This is a migrated thread and some comments may be shown as answers.
Dion
Top achievements
Rank 1
Dion asked on 29 May 2012, 09:55 PM
I followed the instructions for embeding script and skin in a control when outcache is present on a page and I still can't get my code to work.

On my master page I have the following code
<head runat="server">
    <title></title>
    <link id="Link1" runat="server" href="~/Skins/Menu.css" rel="stylesheet" type="text/css" />
    <link id="Link2" runat="server" href="~/Skins/Default/Menu.Default.css" rel="stylesheet" type="text/css" />
    <link id="Link3" runat="server" href="~/Skins/SiteMap.css" rel="stylesheet" type="text/css" />
    <link id="Link4" runat="server" href="~/Skins/Default/SiteMap.Default.css" rel="stylesheet" type="text/css" />
    <link id="Link5" runat="server" href="~/Skins/Tooltip.css" rel="stylesheet" type="text/css" />
    <link id="Link6" runat="server" href="~/Skins/Window.css" rel="stylesheet" type="text/css" />
    <link id="Link7" runat="server" href="~/Skins/Default/ToolTip.Default.css" rel="stylesheet" type="text/css" />
    <link id="Link8" runat="server" href="~/Skins/Default/Window.Default.css" rel="stylesheet" type="text/css" />
    <link id="Link9" runat="server" href="~/Skins/Telerik/ToolTip.Telerik.css" rel="stylesheet" type="text/css" />
    <link id="LinkA" runat="server" href="~/Skins/Telerik/Window.Telerik.css" rel="stylesheet" type="text/css" />
</head>
<telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        <Scripts>
            <asp:ScriptReference Path="~/Scripts/Common/Core.js" />
            <asp:ScriptReference Path="~/Scripts/Common/jQuery.js" />
            <asp:ScriptReference Path="~/Scripts/Common/jQueryPlugins.js" />
            <asp:ScriptReference Path="~/Scripts/Common/jQueryPlugins.js" />
            <asp:ScriptReference Path="~/Scripts/Common/PopUp/PopUpScripts.js" />
            <asp:ScriptReference Path="~/Scripts/Common/Animation/AnimationScripts.js" />
            <asp:ScriptReference Path="~/Scripts/Common/Navigation/NavigationScripts.js" />
            <asp:ScriptReference Path="~/Scripts/Menu/RadMenuScripts.js" />
            <asp:ScriptReference Path="~/Scripts/SiteMap/RadSiteMap.js" />
            <asp:ScriptReference Path="~/Scripts/Window/RadWindowScripts.js" />
            <asp:ScriptReference Path="~/Scripts/Window/RadWindowManager.js" />
            <asp:ScriptReference Path="~/Scripts/ToolTip/RadToolTip.js" />
            <asp:ScriptReference Path="~/Scripts/ToolTip/RadToolTipManager.js" />
            <asp:ScriptReference Path="~/Scripts/Common/TouchScrollExtender.js" />
        </Scripts>
    </telerik:RadScriptManager>
In my usercontrol I have the following declarations
<telerik:RadToolTipManager runat="server" AnimationDuration="300"
    ShowDelay="200" HideDelay="10" ID="RadToolTipManager1" Width="480px"
        RelativeTo="BrowserWindow" Animation="Slide" Position="TopCenter"
    OnAjaxUpdate="OnAjaxUpdate" Skin="Telerik" OffsetY="150" ShowEvent="OnClick" EnableEmbeddedScripts="false" EnableEmbeddedBaseStylesheet="false" EnableEmbeddedSkins="false" />
<telerik:RadWindowManager ID="Singleton" Skin="Telerik" Width="400" Height="630"
    VisibleStatusbar="false" Behaviors="Close,Move, Resize" runat="server"
    EnableShadow="true" OnClientClose="OnClientClose" Animation="Fade"
    AutoSize="false" AutoSizeBehaviors="Default" DestroyOnClose="False"  VisibleOnPageLoad="true"
    ShowContentDuringLoad="False" EnableEmbeddedScripts="false" EnableEmbeddedBaseStylesheet="false" EnableEmbeddedSkins="false">
</telerik:RadWindowManager>
If I take out outputcache from my pages and enable embedded scripts and skins everything works fine. Can someone tell me what I'm doing wrong?

1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 31 May 2012, 04:02 PM
Hi Dion,

What exactly is not working in your case? Have you taken a look at this KB article as well: http://www.telerik.com/support/kb/aspnet-ajax/general/error-telerik-is-undefined-when-using-outputcache-directive-in-a-user-control.aspx? Is this your case? Does setting RegisterWithScriptManager to false make a difference? Please also note that AJAX functionality in this case is not supported because of caching and thus the tooltip manager's ajax requests would break.

Other than that what I can suggest is that you use the RadScriptManager's CDN and the RadStyleSheetManager's CDN. Both these options load the scripts and styles respectively for the RadControls from our external servers. This means that the files are fetched as actual files and not webresources, so this allows for a more aggressive caching. If the end user has loaded the files when visiting another site that uses our controls they will still be in his/her browser cache.

I would also like to note that webresource requests are cached for the page, because their URL does not change unless the server is recycled. Also, when a script is requested with a relative path inside the application it is always reloaded, while external URLs (like the ones from the CDN) are cached.


Regards,
Marin Bratanov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Window
Asked by
Dion
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Share this question
or