RadMenu and OutputCache

13 posts, 1 answers
  1. Keith Henkel
    Keith Henkel avatar
    23 posts
    Member since:
    Dec 2006

    Posted 21 May 2008 Link to this post

    I have customized the Office2007 skin for the RadMenu used as the main menu in our application. The menu control is on a custom control which is cached using the OutputCache directive.

    I've set EnableEmbeddedSkins = False and added the client include for the CSS file from the MasterPage so that the stylesheet is set on all pages in the application. However, I'm getting a Javascript error when I navigate away from the homepage.My debugger breaks on the MicrosoftAjax.js file in its createCallback function. If I take off the output caching the error goes away.

    I suspect this is because the menu script is not downloading? I've set EnableEmbeddedScripts = False and have added this to the MasterPage:

    Page.ClientScript.RegisterClientScriptInclude("RadMenuScript", "~/RadControls/Prometheus/Scripts/Menu/RadMenuScripts.js")

    ...but the problem is still occurring. Any help would be appreciated.

    Thanks,
    Terry

  2. Veselin Vasilev
    Admin
    Veselin Vasilev avatar
    2992 posts

    Posted 22 May 2008 Link to this post

    Hello Keith Henkel,

    Please find attached a file describing the steps to perform.
    It will be included in the online help after the next site update.

    I hope this helps.

    Sincerely yours,
    Veskoni
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. Keith Henkel
    Keith Henkel avatar
    23 posts
    Member since:
    Dec 2006

    Posted 22 May 2008 Link to this post

    Thank you for your help; however, I am still getting an "Object expected" Javascript error when I turn on output caching. If output caching is off, the error goes away.

    I have the script references defined in my master page as follows:
            <telerik:RadScriptManager ID="ieScriptManager" EnablePartialRendering="true" EnableScriptCombine="true" LoadScriptsBeforeUI="false" ScriptMode="Release" runat="server"
                <Scripts> 
                    <asp:ScriptReference Assembly="Telerik.Web.UI" NotifyScriptLoaded="true" Name="Telerik.Web.UI.Common.Core.js" Path="~/RadControls/Scripts/Common/Core.js" /> 
                    <asp:ScriptReference Assembly="Telerik.Web.UI" NotifyScriptLoaded="true" Name="Telerik.Web.UI.Common.Animation.AnimationScripts.js" Path="~/RadControls/Scripts/Common/Animation/AnimationScripts.js" /> 
                    <asp:ScriptReference Assembly="Telerik.Web.UI" NotifyScriptLoaded="true" Name="Telerik.Web.UI.Common.Navigation.NavigationScripts.js" Path="~/RadControls/Scripts/Common/Navigation/NavigationScripts.js" /> 
                    <asp:ScriptReference Assembly="Telerik.Web.UI" NotifyScriptLoaded="true" Name="Telerik.Web.UI.Menu.RadMenuScripts.js" Path="~/RadControls/Scripts/Menu/RadMenuScripts.js" /> 
                </Scripts>       
            </telerik:RadScriptManager> 

    Also, you forgot to mention in your help document to set EnableEmbeddedSkins = False. I have also tried setting EnableEmbeddedScripts = False but that does not make the error go away.

    Thanks



  4. Veselin Vasilev
    Admin
    Veselin Vasilev avatar
    2992 posts

    Posted 23 May 2008 Link to this post

    Hello Keith Henkel,

    Can you send me the page so I can examine it further?

    Thanks

    Kind regards,
    Veskoni
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  5. Keith Henkel
    Keith Henkel avatar
    23 posts
    Member since:
    Dec 2006

    Posted 23 May 2008 Link to this post

    Sorry, this is on a large enterprise application, and I can not send it to you. When output caching is turned on the error does occur on every page in our application though since the menu is on a user control on the master page.

    Can you tell me if I should have EnableEmbeddedScripts set to False in this scenario? Is there anything else you can think of that might cause this error?

    Thank you
  6. Veselin Vasilev
    Admin
    Veselin Vasilev avatar
    2992 posts

    Posted 27 May 2008 Link to this post

    Hi Keith Henkel,

    I have created a small project demonstrating the approach.
    Please download it, put the Telerik.Web.UI.dll file in the bin folder and try it.

    Let me know how it goes.

    Greetings,
    Veskoni
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  7. Keith Henkel
    Keith Henkel avatar
    23 posts
    Member since:
    Dec 2006

    Posted 27 May 2008 Link to this post

    Thanks, I see that you have added two more script references. What is the correct namespace for the one below? This line throws an error, and I can't find the correct namespace for it anywhere in the help doc:

    <asp:ScriptReference Assembly="Telerik.Web.UI" NotifyScriptLoaded="true" Name="Telerik.Web.UI.Popup.PopupScript.js" Path="~/RadControls/Scripts/Common/Popup/PopupScript.js" />                
     

    Also, in your example you now have 6 different scripts that will be manually included on every page from the MasterPage. We are using the RadScriptManager with EnableScriptCombine set to True and ScriptMode set to Release. Will these six scripts also be included in the script resources that get download through the script manager, and therefore get downloaded twice for everything? I'm just wondering what the performance implications of this change are.

    Thanks,
  8. Keith Henkel
    Keith Henkel avatar
    23 posts
    Member since:
    Dec 2006

    Posted 28 May 2008 Link to this post

    I still need more help with this one.

    Thanks
  9. Veselin Vasilev
    Admin
    Veselin Vasilev avatar
    2992 posts

    Posted 29 May 2008 Link to this post

    Hi Keith Henkel,

    RadScriptManager ignores ScriptReferences to scripts embedded in an assembly, but pointed to a script file by
    using the Path property.

    Also, I believe that the best way to proceed is to send us a small and running project, demonstrating the problem.

    Thanks

    Regards,
    Veskoni
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  10. Keith Henkel
    Keith Henkel avatar
    23 posts
    Member since:
    Dec 2006

    Posted 29 May 2008 Link to this post

    Thank you,

    Please answer my question regarding the correct namespace for the ScriptReference further above.


  11. Keith Henkel
    Keith Henkel avatar
    23 posts
    Member since:
    Dec 2006

    Posted 30 May 2008 Link to this post

    Still waiting...
  12. Answer
    Veselin Vasilev
    Admin
    Veselin Vasilev avatar
    2992 posts

    Posted 30 May 2008 Link to this post

    Hello Keith,

    Can you try replacing that line with this one:

    <asp:ScriptReference Path="~/RadControls/Scripts/Common/Popup/PopupScript.js" /> 

    If it does not help - just remove it and let me know the result.

    Greetings,
    Veskoni
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  13. Keith Henkel
    Keith Henkel avatar
    23 posts
    Member since:
    Dec 2006

    Posted 30 May 2008 Link to this post

    Thank you,

    That works. I thought the other attributes on the ScriptReference tag were required when used within the telerik:RadScriptManager.


Back to Top