ScriptManager and Output Caching on User Controls

5 posts, 2 answers
  1. Darrel
    Darrel avatar
    8 posts
    Member since:
    Jun 2008

    Posted 31 Mar 2010 Link to this post

    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.
  2. Answer
    Veselin Vasilev
    Admin
    Veselin Vasilev avatar
    2992 posts

    Posted 05 Apr 2010 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Darrel
    Darrel avatar
    8 posts
    Member since:
    Jun 2008

    Posted 05 Apr 2010 Link to this post

    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.






  5. Answer
    Dimitar Milushev
    Admin
    Dimitar Milushev avatar
    555 posts

    Posted 08 Apr 2010 Link to this post

    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.
  6. Darrel
    Darrel avatar
    8 posts
    Member since:
    Jun 2008

    Posted 08 Apr 2010 Link to this post

    Thanks. That answers my question.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017