Saturday 28 October 2017

MVC - How to add css class to @Html.ValidationMessageFor

Watch this example on YouTube


 

1. CSS
.float-right{
    float: right;
}
2.View

    @Html.TextBoxFor(x=>x.Qty)
    <p class="red">@Html.ValidationMessageFor(x => x.Qty, String.Empty, new { @class ="float-right"})</p>

No comments:

Post a Comment