MVC partial page update
- by GB
Hello,
I have an MVC project where I have a form with fields a user can enter and save. On that same page I have a table which shows a brief listing of information that the user just saved. The problem I am having is trying to update only the table after a save and not an entire page refresh.
Is this possible in jquery or MVC? If so does anyone have an example.
Here is what the action in the controller looks like:
public ActionResult RefreshList()
{
string _employeeID = Request.QueryString["empIDSearch"];
this.ViewData["coursehistorylist"] = _service.ListCoursesByEmpID(_employeeID);
return View("CourseHistoryList");
}
The function in the view: (and this is where I'm confused on how to update only the table)
$.ajax({
url: "/Home/RefreshList",
type: "POST",
success: function(result) {
alert("got here");
},
error: function(xhr, ajaxOptions, thrownError) {
alert(xhr.status + " " + thrownError + " " + ajaxOptions);
}
});
Thanks.