Is your code get executed? If yes, change void to IActionResult and then return Page()
Refresh Page after Submit (POST) Razor Pages
Imran Jalali
101
Reputation points
Hi Friends.
I am deleting a record in the OnPost event of ASP.NET Razor Page. The problem is that the page doesn't refresh itself after submitting... I try to call OnGet method and rebinding my model but that doesn't help.
I found one solution ASPNet-Core-Razor-Pages-Refresh-Page-after-Submit-POST.aspx
It works fine after first submit
Please look at my code and help me please.
Thanks.
public void OnPostDeleteReg(int CommitteeRegId)
{
try
{
CommitteeBO ComitteDesc = new CommitteeBO(_configuration);
int UserId = _appuser.UserID;
ComitteDesc.Delete(CommitteeRegId, UserId);
}
catch (Exception ex)
{
throw ex;
}
}