I have a webform application.
On client side I use custom JavaScript validation to hightlight a textbox and show a validation messages when the text is changed or a submit button is clicked.
The server side validations take place on Submit. It brings back a list of messages (string) to prevent the system saving the form.
The client validation are generic e.g. check “required field”, “word limited”, while the server validation need to work with data record, e.g. “existing name”, “User has to specify option ‘A’ when there are related records in table B.”
The shortcoming of the server side validation is that it only brings back a message summary, but cannot show the msg beside textbox. (how does the server side know each control id or where to show each msg?)
How does server side and client side validation work together in order to show the msg upon each textbox? Any nice designs or architectures for .net ? For sure all client side validation will be duplicated in server side any way.
Thx