I would like add error message to page validation in order to display it on the validation summary but how?
here is my goal on the code behind file;
try {
DateTime.Parse(txtBirthDate.Text);
}
catch (Exception err) {
//Adding error message to page validation
return;
}
NOTE: Of course I used validations on my aspx page and I both validate them on either client side and server side but I waana know if this thing is possible. It can be done on the controller on ASP.NET MVC with ModelState.AddModelStateError()
Method. I am exactly looking for something like that.