开发者

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.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜