I have the main view with model that gets loaded.
User can click a button, which is an AJAX call it does some processing, returns PartialView like so:
//values = Dictionary<string,DataTable>(); with some data
return PartialView("_PartialView1",values)
My ajax call looks like this:
$.ajax({
url: '@Url.Action("Process", "Process1")',
async: true,
type: 'POST',
dataType:"html",
data: {},
success: function (result) {
alert("I'm here");
$('#PartialView').html(result); //I have a Div with this id to render PartialView
}
});
With this code, I am successfully able to render the PartialView
. I added some text in the partial view and it renders where it should.
Question is about the result
. The result will be a Dictionary<string,DataTable>
- I have no idea what I have to do in the partial view to accept
this data.
In my partial view I tried something like:
@model Dictionary<string,DataTable> but to no avail
Any idea how I can set up my partial view to have access to this dictionary?
Do I need to return a model with my partial view from the controller?