public IActionResult SomeAction()
{
return Redirect(Request.GetTypedHeaders().Referer.ToString());
}
public async Task<IActionResult> Edit(int? id)
{
...
...
ViewBag.returnUrl = Request.Headers["Referer"].ToString();
return View(customer);
}