I'm using Unobtrusive Ajax with Razor. When I return a Partial View, only the partial view content returns on a new blank page instead of in the designated div on original page.
<form method="post" data-ajax="true" asp-page-handler="Partial" data-ajax-method="post" asp-route-id="JobNum" data-ajax-success="success" data-ajax-update="#panel">
<input type="submit"/>
</form>
public async Task<IActionResult> OnPostPartialAsync(string id)
{
return new PartialViewResult
{
ViewName = "_IndexPartial",
ViewData = this.ViewData
};
}
expecting the result to be displayed in the with id "panel"