Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Telerik MVC Extensions (superseded) > General Discussions > Partial View Help
Telerik MVC Extensions are no longer supported (see this page for reference). In case you have inquiries about Kendo UI Complete for ASP.NET MVC, post them in the pertinent Kendo UI forums.

Not answered Partial View Help

Feed from this thread
  • jfkrueger Master avatar

    Posted on Jun 15, 2012 (permalink)

    I have the following partial view:

    @model TelerikECommerce.ViewModels.ZoneMaintenanceViewModel
     
    Hello!
     
    @if( Model.ElementValueList != null )
    {
        foreach( var element in Model.ElementValueList )
        {
            @Html.Raw( "Hello Again" )
        }
    }

    Here is the main page:

    @Html.Partial( "ZoneElementsPartial", Model )
     
    @section JavaScript{
        <script language="javascript" type="text/javascript">
            function zone_changed() {
                var dropDownList = $('#Zone').data('tDropDownList');
     
                var urlPath = '@Url.Content( @"~\ContentAdministration\GetZone?zoneId=")';
                urlPath += dropDownList.value();
     
                $.ajax({
                    url: urlPath,
                    dataType: 'html',
                    success: function(data) {
                        $('#ZoneElementsPartial').html(data);
                    }
                });
     
            }
     
        </script>
    }


    The top "Hello!" outside of the code is always displayed as I would expect. However once the dropdown changes and serves up the view again what is inside the code is never output. I have put breakpoints in the code and have watched it go through the loop for each element but it is not being output to the page. What am I doing wrong??

    Thanks!!



  • jfkrueger Master avatar

    Posted on Jun 18, 2012 (permalink)

    I figured it out. Just needed wrap my partial in a div on the main page with the ID and then make sure the javascript was updating the html of that div with the result of the call.

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Telerik MVC Extensions (superseded) > General Discussions > Partial View Help