Как я могу перенаправить на localhost:5001/#contact< /code> после отправки формы вместо возврата к действию Index?
Код: Выделить всё
[HttpPost]
public IActionResult Index(Contact model)
{
if (!ModelState.IsValid)
{
ViewBag.error = "An error occurred! Please try again.";
return View(model);
}
ViewBag.success = "Your message was sent :D";
return View(model);
}
Подробнее здесь: https://stackoverflow.com/questions/790 ... -form-post
Мобильная версия