Compare Control Values with CompareValidator

Updated June 5, 2006
Iron Speed Designer V4.0 and later

This example adds a standard ASP.NET CompareValidator to compare two controls on a page.

Step 1:  In Iron Speed Designer, open the page where you wish to add the control and select the appropriate page area in the Quick Layout Spreadsheet.

Step 2:  Select the control that you want to compare.

Step 3:  Add the CompareValidator control tag at the desired location via the Cell Editor.  For example, suppose you want to compare the EmailAddress and EmailAddressAgain controls.  Add the CompareValidator just below the <GEN:FieldValue Name=" EmailAddress" /> tag:

<GEN:FieldValue NAME=" EmailAddress" />

<asp:CompareValidator

     id="MyCompareValidatorId"

     ControlToValidate="EmailAddress"

     ControlToCompare="EmailAddressAgain"

     Operator="Equal"

     ErrorMessage="Email Addresses must be the same."

     runat="server" />

</td>

See Also

Part IV: Customizing Generated Application Code