I want to load data in the background while the user is on the page. After the data is loaded, I want to display it by using a partial View. So I wrote this:
var serviceURL = '/Vm/GetInformation';
$.ajax({
type: "POST",
url: serviceURL,
data: param = "",
contentType: "application/json; charset=utf-8",
dataType: "json",
data: { "id": id },
//success: resetPartial()
});
In my controller:
public ActionResult GetInformation()
{
myCode...
return PartialView("_List", Costumer);
}
So what is the final step to display that _List partial View in my main view which is now filled with data about costumers (where my ajax function is)
Thank you
load()method from jquery. What you could use is your url as string as you are using it, and then specify a div to load your partial view$("#divToLoad").load(url);where url is your url string to the server