Hi matt,
Based on my understanding, you nested your CompareValidator control in
DataGrid template column, you want to use these nested CompareValidator
control to validate a textbox control on the webform(Outside of DataGrid)
Actually, CompareValidator .ControlToValidate inherits from
BaseValidator.ControlToValidate, please view in MSDN below:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfSystemWebUIWebControlsBaseValidatorClassControlToValidateTopic.asp
You will find:
"BaseValidator.ControlToValidate must be set to the ID of an input control
for all validation controls. The ID must refer to a control within the same
container as the validation control. It must be in the same page or user
control, or it must be in the same template of a templated control."
So you can not use nested CompareValidator to validate a textbox out of
datagrid.
Actually, a validator control is follow with the control you want to
validate, not follow with the control(or value) you want to compare. So if
you really want to validate that textbox, you should remove the validator
control outside of datagrid, in the same hierarchy as the TextBox control.
============================
Please apply my suggestion above and let me know if it helps resolve your
problem.
Thank you for your patience and cooperation. If you have any questions or
concerns, please feel free to post it in the group. I am standing by to be
of assistance.
Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! -
www.microsoft.com/security This posting is provided "as is" with no warranties and confers no rights.