how to validate in modal
问题 I have a modal that returns login view . I want to check if user does not exist return the view with some error . I tried using ModelState.AddModelError() But the modal close and view is opened. this is my code: public IActionResult Login(LoginViewModel login) { if (!ModelState.IsValid) return View(); var user = _userServies.getUserByEmailandPass(login.Email, login.Password); if (user == null) { ModelState.AddModelError("Email","email or password is wrong"); return view(); } return Redirect("