Trying to add “data-validation” attribute to mvc 5 razor view text input editor.

@Html.EditorFor(model => model.Name, new { htmlAttributes = new { @class = "form-control" } })

want to add: data-validation="length" data-validation-length="min3" data-validation-error-msg="3 char"

Related posts

Recent Viewed