Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Telerik MVC Extensions (superseded) > PanelBar > PanelBar OutputCache issue

Not answered PanelBar OutputCache issue

Feed from this thread
  • Posted on Feb 7, 2012 (permalink)

    I am having difficulty to cache the PanelBar using the `OutputCache` attribute.
    The control works the first time it is rendered but after being cached clicking on the PanelBar does not have any effect (it does not perform the open/close animations).

    It is used as follows:

    Controller
    [OutputCache(Duration = 60*5)]
    public PartialViewResult NavigationMenu()
    {
        return PartialView();
    }

    View
    @Html.Action("NavigationMenu", "Home")

    _Layout.cshtml
    @(Html.Telerik().ScriptRegistrar()
                     .DefaultGroup(group => group
                     .Add("telerik.common.js")
                     .Add("telerik.panelbar.js")
                     .Compress(false)))

    Looking at FireBug's output it does not provide and JavaScript or download errors.
    I must be missing a basic step but cannot work it out.

    I am using 2011.3.1115 (Update: 2012.2.214 also behaves the same)

    Update:
    Running diff between the working and non-working HTML showed that the following generated scripts is missing:
    <script type="text/javascript">
    //<![CDATA[
    jQuery(document).ready(function(){
    jQuery('#NavigationMenu').tPanelBar({effects:{list:[{name:'property',properties:['height','opacity']}],openDuration:200,closeDuration:300}, expandMode:1});});
    //]]>
    </script>

    How do I get it to generate the required JavaScript?

    Thank you,
    Philip

    Reply

  • Mike avatar

    Posted on Aug 6, 2012 (permalink)

    Philip,
    Did you ever get an answer to this or get it figured out? I am having a similar issue with the exception that the script output is never being generated in my case.

    Thank you

    Mike Wasmer

    Reply

  • Posted on Aug 9, 2012 (permalink)

    Hi Mike,

    Unfortunately I have not found an answer.   Please post here if you manage to find a solution.
    I would really like to cache this control as it is the slowest part to render on my web pages :(

    Kind regards,
    Philip

    Reply

  • Posted on Oct 6, 2012 (permalink)

    I recently fall in a bug of caching a MVC treeview in a partial view. The treeview works fine for the first time the page loads, but subsequent requests fails.

    After taking a quick view of the source code, I think it may an architectural problem in Telerik MVC extensions. The treeview register jquery block to ScriptRegistrar, and the scriptRegistrar collects script block of the page and renders them in a central place. As the treeview (or the PanelBar in your case) is cached, the Render() function of these controls is not called, and so no script is registered to the ScriptRegistrar ......

    I wish I am wrong .....

    Reply

  • Posted on Oct 28, 2012 (permalink)

    Hi Jian,

    Have had any luck resolving this issue?   Unfortunately I have not yet found a solution.

    Kind regards,
    Philip

    Reply

  • Posted on Oct 28, 2012 (permalink)

    Unfortunately, I found no simply solution :-(

    In your case, may be you can choose one of the following:

    1) cache the data that is used for rendering the Panel instead of caching the partial view
    2) define a method such as JsonNavigationMenu() that returns the json data for the panel, so you can use OutputCache.
    3) Use ajax to get the partial view

    I guess (1) is the easiest way with minimum effort.

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Telerik MVC Extensions (superseded) > PanelBar > PanelBar OutputCache issue
Related resources for "PanelBar OutputCache issue"

ASP.NET MVC PanelBar Features  |  Documentation  |  Demos  |  Telerik TV ]