C
C#13mo ago
deichor

✅ How to clear old message on refresh page?

I have wrong password output but it doesn't remove when i refresh page. Why?
No description
5 Replies
MODiX
MODiX13mo ago
How to get the best help catpog Make a post in #help or one of the topic channels under Development. Avoid askingcatthinking Can anybody help catthinking Has anyone used catthinking Why doesn't my code work? C# is a big area! No one knows they can help unless you tell them about the small area you're trying to work in. Explain what you are doing, and potentially why for as much context as possible. Avoid screenshots where possible, share code directly in Discord. Type $code into chat to learn how to post code. See https://www.nohello.net and https://dontasktoask.com if you want common help chat room etiquette.
Buddy
Buddy13mo ago
Please post code and add more context
Accord
Accord13mo ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
deichor
deichorOP13mo ago
@if (ViewData["Login"] == "wrong_password")
{

<div class="login-wrong-password">
<span>Kullanıcı adı veya parola hatalı!</span>
</div>

}

@if (ViewData["Login"] == "wrong_password")
{

<div class="login-wrong-password">
<span>Kullanıcı adı veya parola hatalı!</span>
</div>

}

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();
}

}
}
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();
}

}
}
Accord
Accord13mo ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server