I am creating a form in ASP.NET MVC and creating the field "DataMessage", at first I put the TextBox to load a date with the month in full, as below:
Image of the form with the field "Message date" containing the month in full.
Below, the View code for the "Message Date" field:
Image of the View code used to create the "Message Date" field with the month in full.
When I create the field in this way, in addition to loading correctly, I can seamlessly send data to the database in case of a possible change.
However, when I use the format to abbreviate the Month and only display the Month's number, the validation does not allow me to send the same to the database in case of a possible message change.
Below, the form with the "Message date" field loaded correctly with the abbreviated month:
Image of the form with the "Message date" field containing the abbreviated month, with the error displayed when clicking the "Save" button.
Below, the View code for the "Message Date" field with the abbreviated month: Image of the View code used to create the "Message Date" field with the abbreviated month.
And below, the model used for the "Message Date" field:
Model of the "Message Date" field.
Does anyone know why this problem is happening and how can I resolve it? Thanks in advance.