ASP.NET CompareValidator compare against sub control
I have a custom control "FieldGroup" which contains an asp:TextBox and some other functionality. The asp:TextBox is exposed through a public property "TextBox".
On the page that uses my FieldGroup I am having a password entry which means I have two of them and I want to use a CompareValidator to confirm that the values are the same. I could do this with a CustomValidator but I would like to make use of the CompareValidator's client side script.
I 开发者_JAVA技巧tried setting the ControlToValidate="fieldA.TextBox" and the ControlToCompare="fieldB.TextBox" but that is not working. Is something like this even possible?
Better late than never...
Apply the ValidationPropertyAttribute to the user control class.
精彩评论