A
A
Alexander Solovkin2018-09-25 19:27:57
ASP.NET
Alexander Solovkin, 2018-09-25 19:27:57

How to properly validate on the client in an ASP.NET table row?

I made a page in ASP.NET CORE with editing directly in table:
5baa614d7e33a577793568.png
In model, this field is annotated like this [RegularExpression(@"^[1-9]+[0-9]*[\.,]{0,1}[0- 9]{0,2}",ErrorMessage ="Invalid number format")].
In the view, respectively:

<td>
    <h4>
        <input asp-for="@item.RateString" />
    </h4>
        <span asp-validation-for="@item.RateString" class="text-danger" style="margin-left:32px"></span>
</td>

Actually a question: How to make so that this message appeared only for that line in which an error?
I don't like editing in a separate form. Only one field needs to be changed.
You can, of course, get by with validation on the server, but och. do not want.
Help experts. Or is there a ready solution?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question