Let us continue with the application that we built in the previous chapter. To do server-side validation, we need to do the following:
ViewModelsmodel class. The input data is validated against this metadata and the model state is updated automatically.
viewmethod to display the validation message for each of the fields. The
spantag helper with the
asp-validation-forattribute will be used to display the validation error message.
viewmethod is rendered again with the validation error message so that ...