I receive a validation message for textboxfor
string field before pressing submit, how to fix this?
Hi, everyone. I am working on a c# mvc application. I validate a string property as Required in a ViewModel. Here is my code from the ViewModel:
Here is the code from the View:
The problem is that when I go to the view, the required error message is shown even though I haven't pressed submit, and I want it to be displayed only if I press Submit and haven't entered anything. How should I fix that?