how to compare ImageVerifier text with the textbox value using comparevalidator in asp.net?

557 views Asked by At

I am using PasswordRecoverycontrol in asp.net and have placed Imageverifier in the question template of this control which has captcha image. I want to compare the imageverifier text and the text user enters in the textbox below the image using comparevalidator. I cannot do it in code behind because a lot of methods run once the page loads and I want to avoid that if the text doesn't match.

2

There are 2 answers

0
vijay vangaveti On
0
meghna On

Well Thank you guys for your input . I was able to solve this problem. As PasswordRecovery_VerifyingAnswer event i compared the value in textbox and the image text in ImageVerifier and threw Exception and added e.cancel=true which prevented the code to run any further and displayed the error message in failuretext label.