I'm facing an issue with ajax request in razor page. My ajax post request is mentioned below and it's hitting the OnPostabc method in my page modal.
type: "POST",
url: path + '?handler=abc',
contentType: 'application/x-www-form-urlencoded',
data: { a: b, c: d,
headers:
{
"RequestVerificationToken": $('input:hidden[name="__RequestVerificationToken"]').val()
},
success: function(data, textStatus) {
console.log("DOne");
}
});
So in my OnPostabc method, i'm redirecting page using return RedirectToPage(); and i will hitting the onget method in my page modal.
public virtual async Task<ActionResult> OnPostSaveLoanSetupAsync([FromRoute] Guid p, [FromRoute] Guid q, string a, string c)
{
return RedirectToPage();
}
So the thing is, in my onget return page(),
public override async Task<ActionResult> OnGetAsync([FromRoute] Guid p, [FromRoute] Guid q)
{
return Page();}
issue is. page is not refreshing after ajax request and not updating the url with handler