Returning a variable from a foreach-loop ASP.NET Core 5.0
I'm trying to return a password from a foreach-loop to do some validations, but I can't get the password-variable to return. I keep getting errors. I do this in my controller. My code: [HttpPost] public IActionResult Login(userModel user) { ViewBag.Password…