开发者

ASP.NET CompareValidator compare against sub control

开发者 https://www.devze.com 2023-01-06 09:54 出处:网络
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\".

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消