I have tried in several ways, I need to get the value of the current URL, and move to the next page, so that after the create action is completed, I go back to the URL that was passed, how can I proceed? Thank you.
I'm trying this way:
string urlAnterior = Request.Headers["Referer"].ToString();
if (urlAnterior.Contains("Pagina"))
return RedirectToAction("");
else
return RedirectToAction("");
And also like this:
string urlAnterior = Request.Headers["Referer"].ToString();
if (urlAnterior.Contains("Pessoa"))
return RedirectToAction("Edit", "Pessoa");
else
return RedirectToAction("Index", "ContaReceber");
But neither worked, wanted to save the URL in a variable for example, and move to the next page, so he would know correctly, where to go back.
EDIT:
Here is where I call the create page of accounts receivable, passing the id parameter of the person who is in the edit.
<a asp-page="/ContaReceber/Create" asp-route-id="@Request.Query["id"]" class="btn btn-primary btn-sm">Criar nova Conta</a>