ShareItException

@Html.Errors()

Will display a list of errors as defined by ViewBag.Error containing either a string type or System.String[] type.

Usage.

Razor
@Html.Errors()
C#
ViewBag.Error = "This is wrong";
C#
List<string> errors = new List<string>();

errors.Add("This is wrong 1");
errors.Add("This is wrong 2");

ViewBag.Error = errors.ToArray();