@model AHP2.Models.User

@{
    ViewBag.Title = "Register";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

@using (Html.BeginForm())
{
    
    <div class="row" style="margin-top:10px; color:green;">
        <div class="col-md-offset-4 col-md-4 validationSummary">
            @Html.ValidationSummary()
        </div>
    </div>
    <div class="row">
        <div class="col-md-offset-4 col-md-4">
            <h2>Registration</h2>
        </div>
    </div>
    <div class="row">
        @if (ViewBag.Message != null)
        {
            <div class="col-md-12" style="font-size:small; color:@ViewBag.Color;">@ViewBag.Message</div>
        }
    </div>
    <div class="row">
        <div class="col-md-offset-3 col-md-6 well well-sm">
            <div class="row">
                <div class="col-md-offset-3 col-md-3">
                    @Html.LabelFor(u => u.EmailAdress)
                </div>
                <div class="col-md-3">
                    @Html.TextBoxFor(u => u.EmailAdress)
                </div>
            </div>
            <div class="row" style="margin-top:15px;">
                <div class="col-md-offset-3 col-md-3">
                    @Html.LabelFor(u => u.Password)
                </div>
                <div class="col-md-3">
                    @Html.PasswordFor(u => u.Password)
                </div>
            </div>
            <div class="row" style="margin-top:15px;">
                <div class="col-md-offset-3 col-md-3">
                    @Html.LabelFor(u => u.ConfirmPassword)
                </div>
                <div class="col-md-3">
                    @Html.PasswordFor(u => u.ConfirmPassword)
                </div>
            </div>
            <div class="row">
                <input class="btn btn-primary" type="submit" value="Create" />
            </div>
        </div>
    </div>
}
<script>
    $(document).ready(function () {
        alert("a");
        var list = $(".validationSummary").children();
        var count = list.length;
        for (i = 0; i < count; i++) {
            $(list[i]).css('color', 'red');
        }
    })
</script>