I have a page using a model with a partial like so:
@Html.Partial(string PartialViewName)
The partial is using the same model as parent. There is inputs on parent page with button. That button has a onclick script:
//onClick search button
$("#searchSubmitButton").on("click", function () {
var sYear = $("#startPnr").val();
var eYear = $("#endPnr").val();
//Validation?
debugger;
$.ajax({
url: '@Url.Action("FilterPerson", "Kostnadsstalle")',
data: { startYear: sYear, endYear: eYear },
error: function () { console.log("Error, Ajax Error.") },
type: "POST",
//success: function (data) {
// $('#')
//}
});
});
Want I think i want is to have the controller action send back a populated model and then in the Ajax the success: function (data)
will update the partial with that new model data.
How can this be achieved? Does anyone have a better idea? I am very new to this and i will give further information as requested. Thanks