How Does RadCaptcha Control Validate User Input?

2 posts, 0 answers
  1. Jason
    Jason avatar
    1 posts
    Member since:
    Sep 2013

    Posted 10 Sep 2013 Link to this post

    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? 
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 11 Sep 2013 Link to this post

    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,
Back to Top