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

Rad captcha image refreshing only once

5 Answers 345 Views
Sharepoint Integration
This is a migrated thread and some comments may be shown as answers.
Jiju
Top achievements
Rank 1
Jiju asked on 04 May 2012, 11:35 AM
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

5 Answers, 1 is accepted

Sort by
0
Slav
Telerik team
answered on 07 May 2012, 10:00 AM
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.
0
Jiju
Top achievements
Rank 1
answered on 11 May 2012, 01:12 PM
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.
0
Slav
Telerik team
answered on 15 May 2012, 03:23 PM
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.
0
Sajid
Top achievements
Rank 1
Iron
answered on 07 Feb 2025, 10:55 AM

Hi,

 

I tried to check into Network tab and there is 206 error into it when image is not loading while refreshing the captcha.

can you please help me . Sometime it is loading properly and sometime not

0
Rumen
Telerik team
answered on 07 Feb 2025, 02:19 PM

Hi Sajid,

Here are some steps to troubleshoot and potentially resolve the issue with the RadCaptcha image refreshing twice and causing validation to fail:

  • Web Farm / Web Garden scenario: This is a common scenario when the captcha is loaded in a web farm/garden where multiple servers handle the requestsand serve the responses. Make sure that you have applied all the recommendations from the documentation and this forum post:

  • Investigate Double Refresh: The issue of the captcha image refreshing twice might be due to multiple requests being triggered. This can happen if there is a misconfiguration in your code or if multiple events are triggering the refresh. Ensure that the refresh is only triggered once per user action.

  • Network Inspection: The 206 status code indicates a partial content response. This might suggest an issue with how the image is being served. Use the browser's network tools to inspect the response headers and ensure that the requests for the captcha image are being completed successfully. Look for any discrepancies in the requests that succeed versus those that fail.

  • URL Rewriting: If you are using URL rewriting, ensure that it is not affecting the requests made to Telerik.Web.UI.WebResource.axd, WebResource.axd or ScriptResource.axd, which are responsible for serving embedded resources like the captcha image. You can find more details on troubleshooting web resources here:

    http://www.telerik.com/help/aspnet-ajax/introduction-web-resources-troubleshooting.html
  • Check Server Configuration: Ensure that your server configuration is not causing issues with partial content delivery. If you have any custom settings related to compression or caching, try disabling them temporarily to see if it resolves the issue.

  • Disable CDN and Compression: If you are using a Content Delivery Network (CDN) or have compression enabled in your web configuration, try disabling them to see if the issue persists. Double compression or CDN settings might interfere with the image loading.

  • Cross-Browser Testing: Test the page on different browsers to see if the issue is browser-specific. This can help determine if the problem is related to browser settings or compatibility.

  • Test with the latest version.

Please provide more specific information about your setup if these steps do not resolve the issue. Include details such as Ajax usage, server configuration, or any custom scripts that might affect the captcha behavior. This will help in diagnosing the issue more effectively.

    Regards,
    Rumen
    Progress Telerik

    Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Telerik family, check out our getting started resources
    Tags
    Sharepoint Integration
    Asked by
    Jiju
    Top achievements
    Rank 1
    Answers by
    Slav
    Telerik team
    Jiju
    Top achievements
    Rank 1
    Sajid
    Top achievements
    Rank 1
    Iron
    Rumen
    Telerik team
    Share this question
    or