Rad captcha image refreshing only once

4 posts, 0 answers
  1. Jiju
    Jiju avatar
    57 posts
    Member since:
    Jul 2011

    Posted 04 May 2012 Link to this post

    Hi,
    In my page, when clicking on generate new image linkbutton of the radcaptcha, the captcha image refreshes once.
    but when clicking on second time, no postback happens.
    please provide your feedback

    Thanks
    Jiju
  2. Slav
    Admin
    Slav avatar
    1355 posts

    Posted 07 May 2012 Link to this post

    Hello Jiju,

    Most probably the second request for the RadCaptcha image is not successful. I will need a more detailed description of your setup and the encountered problem as it appears to be specific to your implementation. You can use the Net tab of Firebug or the Developer tools of Internet Explorer in order to check if there is a problem with the captcha image request.

    If you are using URL Rewriting the specified rule may rewrite requests made to WebResource and thus break the RadCaptcha refresh image functionality. You can check this article for more information if this is the case.

    Note that currently I am mostly guessing as to what your setup is. If you are still having difficulties, please send a live URL to your problematic page so that I can examine the issue and provide a more to the point answer.

    Kind regards,
    Slav
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.

  3. Jiju
    Jiju avatar
    57 posts
    Member since:
    Jul 2011

    Posted 11 May 2012 Link to this post

    Hello Slav,

    Now I have replaced the 'Generate New Image' button of RadCaptcha with a link button and new textbox to enter the captcha text in order to validate. On the click event of link button, i'm performing a postback so that captcha image gets refreshes without any issue. But now another issue is that the text is always validated as false. This is because, what i noticed from Net tab of FireFox is, after a postback, the captcha image refreshes twice(one intermediate change is happening) and the validation is done with the intermediate value. Hence the validation returns always false. The strange thing is that this validation is false not for all machines, but for some machines.

     Please provide your feedback.

    Regards
    Jiju.
  4. Slav
    Admin
    Slav avatar
    1355 posts

    Posted 15 May 2012 Link to this post

    Hi Jiju,

    Please verify if you are using Ajax on your page. By default the security code is changed every time the page goes through its life cycle, which happens during an Ajax request as well. Note that if the RadCaptcha is not updated on an Ajax request, the displayed code will remain the same, but the actual code will be reloaded due to the page's lifecycle. You can avoid this effect by setting the property CaptchaImage-PersistCodeDuringAjax to true in order to ensure that the captcha code will not be changed when the Ajax call is initiated.

    If this is not the problem in your case, I have prepared two sample pages - the first demonstrating the default approach for image refresh and the second showing the method that you described. Please compare them with your actual project and let me know what changes should be made so that I can reproduce the problem on my end, as currently I am unable to do so.

    All the best,
    Slav
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top