i am trying to display an element of a certain view inside another view in asp-mvc4
in index1.cshtml:
<div id="divToUpdate"></div>
in index2.cshtml:
<div id="sss"><table id="grid1"></table></div>
<div id="fff">Hello!</div>
in my javascript file:
$('#ThisIsALink').click(function () {
$('#divToUpdate').load('../Employee/Index #fff');
});
this script will show “Hello!” in the div in index1.cshtml… but if i write ‘../Employee/Index #sss’ instead, my table (which is actually a jqgrid) is not shown. why is that?
The reason is that your table is created by javascript.
The javascript used for your table
jqgridwill not be executed, so your jqgrid will not be shown.