Dynamically add Views in "ViewContainer" in ASP.NET MVC -
i trying make following layout: http://i.imgur.com/js8ho.png
(i cannot put image directly because of spam rules.)
want use layout file loads headerview, sidebarcontainerview , contentcontainerview. controller needs add datagrid sidebarcontainerview. when click on row in dataview chartview has open inside contentcontainerview. problem adding dynamically view inside contentcontainerview. tried html.renderpartialview , sections don't result want.
i'm in beginner stage of learning mvc 4.0 might easy question google doesn't seem know answer.
thanks in advance
<div id="contentcontainerview"> </div>
in sidebarcontainerview:
you should bind row click event function:
function addchart(charttype) { $.getjson("/mycontroller/addchart", { charttype: charttype }, function (data) { $('#contentcontainerview').append(data); }); }
data here partial chart view, appended contentcontainerview. note should serialize chart view before returning json addchart action method.
Comments
Post a Comment