0
다음 코드는 앵커가있는보기로 리디렉션하고 작동합니다. 그러나 유효성 검사를 위해 모델 상태를 보내야하고 리디렉션을 사용하는 동안 어떻게해야하는지 잘 모르겠습니다. 유효성 검사 요약을 채우기 위해 모델 오류를 설정하려고합니다.MVC ASP.NET - 모델 상태가 앵커 리디렉션
[HttpPost]
public ActionResult Send(QuoteModel model, string CatchAll)
{
try
{
if (ModelState.IsValid)
{
}
else
{
ModelState.AddModelError(string.Empty, "There is something wrong with Foo.");
return Redirect(Url.RouteUrl(new { controller = "Home", action = "Index"}) + "#quote");
}
}
catch
{
return View();
}
}