This is a migrated thread and some comments may be shown as answers.

How Does RadCaptcha Control Validate User Input?

1 Answer 161 Views
Captcha
This is a migrated thread and some comments may be shown as answers.
Jason
Top achievements
Rank 1
Jason asked on 10 Sep 2013, 03:25 PM
Good Morning,

I am a SP 2013 farm admin and have a tenant in one of my farms utilizing this control. We were able to deploy their product through our staging environments without any issue, but once we hit production the control stopped validating properly. It appears fine but when a user enters the correct text and tries to submit their form, the control kicks back and says the text doesn't match the image. 

My question: How does this control actually perform validation? Is this all done server-side utilizing the telerik packages we installed on the system, or is a web service (or other external) call made that could possibly be blocked at the prod level? 

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 11 Sep 2013, 07:57 AM
Hi Jason,

RadCaptcha control does not support client-side validation. A post back to the server is always needed in order for the Captcha to perform validation with the help of the Telerik RadControls DLL deployed in the server. The CaptchaValidate server side event can be used to cancel the default validation mechanism of the captcha control and to specify your own logic for validating the RadCaptcha. RadCaptcha neither makes any external calls nor requires any web service calls to perform the validation mechanism.

Please note if you dynamically create the Captcha control, you must add it to the page on every postback, and before the ViewState is loaded. That is if you add the control in the Page.Load, it is too late, because the ViewState has been loaded, and the Captcha will always invalidate the code and I suggest you use the Page.Init method instead.

Suppose you are using a RadAjaxPanel or an Updatepanel in your application, RadCaptcha does not properly validate the code entered if your code is not properly written and maintained like an ajax request executed before the Captcha control is validated. In such scenarios RadCaptcha should be placed inside the Updatepanel (Reason : The RadCaptcha always returns false, because after clicking the "Post Back" control such as a button, a new Captcha code is generated, but not shown on the image. RadCaptcha is designed to refresh its image on every postback and ajax request, no matter if the ajax request affects the image itself.To resolve the issue, please set UpdateMode="Always" to the UpdatePanel containing the RadCaptcha control).

You can also have a look at this documentation on Using RadCaptcha in a WebFarm/WebGarden Environment.

Hope this helps,
Shinu.
Tags
Captcha
Asked by
Jason
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or