Client-side rendering of Partial Views

2 posts, 0 answers
  1. IT Dept
    IT Dept avatar
    15 posts
    Member since:
    May 2010

    Posted 30 Mar 2017 Link to this post

    Hello everyone, I need to fill panel bar content with partial views. My current code is


            .Items(panelbar =>
                foreach (IFilterCategory filterCateg in Model)
                .Content(@<text><div style="padding-top:5px;padding-left:5px;padding-right:5px">
    @Html.Action(filterCateg.Action, filterCateg.Controller, new { filterCateg = filterCateg })</div></text>);


    and after reading the following post

    i tried to achieve client side rendering by using LoadContentFrom and .Action() without success. The best try was hitting the controller but the object filterCateg is null.

    Thanks in advance.

  2. Nencho
    Nencho avatar
    1886 posts

    Posted 03 Apr 2017 Link to this post


    Indeed, the referenced post covers the possible scenarios to load content in the Items of the panelBar. In addition, your current implementation also seems correct. I am afraid, however, that we cannot be sure why the filterCateg is empty when you attempt to create items base on each one of them. Please make sure that the model is correctly filled and passed to the view, where you aim to use them. 

    You can event test the correct passing of the model in a separate section, not within the panelbar itself. In addition, you can try using the BindTo method, as demonstrated in the following forum thread:

    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top