public class UserController : Controller{ // GET [HttpGet] public IActionResult Login() { return View(); } // get login datas [HttpPost] public async Task<IActionResult> Login(string username, string password) { LoginMatcher lm = new LoginMatcher(username, password); User? user = lm.Loginner(); if (user != null) { Console.Out.WriteLine("giriş başarılı"); return Json(new { status="error",message="acces accept"}); } else { ViewData["Login"] = "wrong_password"; return View(); } }}
@if (ViewData["Login"] == "wrong_password") { <div class="login-wrong-password"> <span>Kullanıcı adı veya parola hatalı!</span> </div> }