Summary
In this chapter, we explored how MCMS placeholder controls can be validated. We started by showing that the validation web controls shipped with ASP.NET can’t be used with MCMS placeholder controls. To get around this limitation, we built three validation controls, one for the HTMLPlaceholderControl
, a second for the SingleImagePlaceholderControl
, and a third for the SingleAttachmentPlaceholderControl
. We demonstrated how simple checks for empty placeholders can be performed using client-side scripting techniques. We also illustrated that server-side validation is possible by building custom placeholder controls. The methods discussed in this chapter can be extended to cover more complex and rigorous validation requirements from checking to see if telephone numbers, zip codes or email addresses are in a valid format to validating against content stored in an external database.