Hi,
You can use
@if (!ViewData.ModelState.IsValid)
{
<div>Error description</div>
}
In controller
if (yourError)
{
ModelState.AddModelError("Error", "Ex: This login failed");
return View();
}
and in View page
@Html.ValidationMessage("Error")
Hope this helps you a bit.
Regards,
RK