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

ScriptManager and Output Caching on User Controls

4 Answers 134 Views
ScriptManager and StyleSheetManager
This is a migrated thread and some comments may be shown as answers.
Darrel
Top achievements
Rank 1
Darrel asked on 31 Mar 2010, 11:48 PM
For a project I am trying to add output caching to a user control.    The user control has a radpanel inside of it. 
The problem with this is when a cached version of the usercontrol is used, the appropriate Javascript is not added to the page.
Is there any easy way from  outside of the user control to tell the RadScriptmanager which javascript should be added in order for the RadPanel to work?    I need the system to remember the script that was added when the control was first cached, and re add  it on later incidences.

4 Answers, 1 is accepted

Sort by
0
Accepted
Veselin Vasilev
Telerik team
answered on 05 Apr 2010, 01:52 PM
Hi Darrel,

We have an article how to use RadMenu with OutputCaching here.
You can use it as a reference, just include the proper skin and javascript files.
The needed js files are:

<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/Navigation/NavigationScripts.js" />
   <asp:ScriptReference Path="~/Scripts/PanelBar/RadPanelBarScripts.js" />
</Scripts>

Hope this helps.

Sincerely yours,
Veskoni
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Darrel
Top achievements
Rank 1
answered on 05 Apr 2010, 04:59 PM
Thanks for the reply Veskoni 

That article you pointed me to was helpfull.

For a further question, is there a way I can add the script by referencing the embedded resource inside assembly, instead of copying the scripts files to the application? It would make maintenance and deployment easier.  I would like to add the scripts by some line like below

RadScriptManager1.Scripts.Add(New ScriptReference("Core.js", "Telerik.Web.UI")), 

except I don't know the naming convention used  for the embedded resources.






0
Accepted
Dimitar Milushev
Telerik team
answered on 08 Apr 2010, 12:15 PM
Hi Darrel,

The convention is to replace '~/Scripts' in the path with 'Telerik.Web.UI' and replace the slash with a dot. For example if the Path is "~/Scripts/Common/Core.js" the resource in the assembly is "Telerik.Web.UI.Common.Core.js". The Panelbar scripts will be "Telerik.Web.UI.PanelBar.RadPanelBarScripts.js".

You can find the rest of the Paths in the 'Disabling embedded resources' help article.

Regards,
Dimitar Milushev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Darrel
Top achievements
Rank 1
answered on 08 Apr 2010, 03:14 PM
Thanks. That answers my question.
Tags
ScriptManager and StyleSheetManager
Asked by
Darrel
Top achievements
Rank 1
Answers by
Veselin Vasilev
Telerik team
Darrel
Top achievements
Rank 1
Dimitar Milushev
Telerik team
Share this question
or