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

RadMenu and OutputCache

12 Answers 226 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Keith Henkel
Top achievements
Rank 1
Keith Henkel asked on 21 May 2008, 09:27 PM
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

12 Answers, 1 is accepted

Sort by
0
Veselin Vasilev
Telerik team
answered on 22 May 2008, 09:19 AM
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
0
Keith Henkel
Top achievements
Rank 1
answered on 22 May 2008, 04:15 PM
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



0
Veselin Vasilev
Telerik team
answered on 23 May 2008, 03:05 PM
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
0
Keith Henkel
Top achievements
Rank 1
answered on 23 May 2008, 03:27 PM
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
0
Veselin Vasilev
Telerik team
answered on 27 May 2008, 07:38 AM
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
0
Keith Henkel
Top achievements
Rank 1
answered on 27 May 2008, 04:33 PM
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,
0
Keith Henkel
Top achievements
Rank 1
answered on 28 May 2008, 09:25 PM
I still need more help with this one.

Thanks
0
Veselin Vasilev
Telerik team
answered on 29 May 2008, 01:28 PM
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
0
Keith Henkel
Top achievements
Rank 1
answered on 29 May 2008, 02:55 PM
Thank you,

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


0
Keith Henkel
Top achievements
Rank 1
answered on 30 May 2008, 02:10 PM
Still waiting...
0
Accepted
Veselin Vasilev
Telerik team
answered on 30 May 2008, 03:20 PM
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
0
Keith Henkel
Top achievements
Rank 1
answered on 30 May 2008, 04:36 PM
Thank you,

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


Tags
Menu
Asked by
Keith Henkel
Top achievements
Rank 1
Answers by
Veselin Vasilev
Telerik team
Keith Henkel
Top achievements
Rank 1
Share this question
or