I have problem loading partial views in mvc. Im trying to load the view with jquery and it kind of works. It either displays two divs filled with the right information or four filled with the same. But it loops through the array so the in paramater changes and I get a warning.
The process or thread has changed since last step
I have a array in jquery that is filled with four values and I need the value in that list as a paramater in the ActionResult.
The code I have
public ActionResult TvShow(string channel)
{
var model = un.SortAllPrograms(channel);
return PartialView("TvShow", model);
}
and jquery
$(document).ready(function () {
var nameOfChannel = ["TV3", "TV4", "TV6", "TV8"];
debugger
$.each(nameOfChannel, function (index, value) {
$('.showContainer').append('<div class="number">' + value + '</div>');
$('.number').load('Home/TvShow', { channel: value });
});
});
I would really appreciate some help or advice on how to make this work.