Maybe like that:
[HttpPost]
public ActionResult Register(Member member)
{
try
{
if (!ModelState.IsValid)
{
ModelState.AddModelError("keyName", "Form is not valid");
return View();
}
MembersManager.RegisterMember(member);
}
catch (Exception ex)
{
ModelState.AddModelError("keyName", ex.Message);
return View(member);
}
}
And in display add:
<div class="alert alert-danger">
@Html.ValidationMessage("keyName")
</div>
OR
<div class="alert alert-danger">
@Html.ValidationSummary(false)
</div>