I have a div which contains a generic styling and error message if a user enters the wrong username/password combo.
I only want to display this div if the user has entered the wrong information. Is there something on my View I could do, something like:
@if(ModelState.HasErrors)
{
<div>This login failed</div>
}
Side note, can’t you use the built-in Validation helpers?
Controller:
View: