Implementing Server-Side Validation
We have seen how validation can be performed against the HtmlPlaceholderControl
using client-side scripts. Client-side validation essentially reduces round-trips to the server just to find out if they have left out any fields. However, client-side validation does have its limitations. For instance, we can’t exactly be 100% sure that the validation did take place on the client. The user could have made a copy of the page, fired up his or her favorite HTML editing tool and modified the page to remove any form of validation. If that happens, invalid content may still find its way into the system.
In addition, not all types of validation can be done on the client. For example, you may need to match the contents of a placeholder control against an existing store of information in an online database. Or perhaps requirements dictate performing routines that can only be executed on the server.
In this example, we will extend our simple check for an empty placeholder...