The following example demonstrates how to use the Eclipse Web Solutions Asp.net DatePicker control with the Asp.net validators.
The most important thing to note is that the EnableClientScript property must be set to false. This is because the Asp.net validator's client scripting inherantly only works with controls that map to a single HTML element (read Microsoft's description of the issue).
The example shows how to use the datepicker with a required field validator, a compare validator and a regular expression validator.
<cc1:DatePicker ID="DatePicker1" runat="server" /> <asp:Button ID="Button1" runat="server" Text="Validate" /><br />
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" EnableClientScript="false"
runat="server" ErrorMessage="Datepicker is a required field." ControlToValidate="DatePicker1"></asp:RequiredFieldValidator><br />
<asp:CompareValidator ID="CompareValidator1" EnableClientScript="false" runat="server"
ErrorMessage="Failed data type check." ControlToValidate="DatePicker1" Operator="DataTypeCheck" Type="Date"></asp:CompareValidator><br />
<asp:RegularExpressionValidator ID="RegularExpressionValidator1" ValidationExpression="\d\d/\d\d/\d\d\d\d" EnableClientScript="False"
ControlToValidate="DatePicker1" runat="server" ErrorMessage="Failed regular expression check. (dd/mm/yyyy)"></asp:RegularExpressionValidator>