Reusing RadCaptcha

5 posts, 1 answers
  1. An
    An avatar
    23 posts
    Member since:
    Aug 2013

    Posted 05 Aug 2013 Link to this post

    I am putting RadCaptcha in a usercontrol .ascx so I can re-use it in several pages on "my" website.   I put the .ascx with the RadCaptcha on 3 pages.  RadCaptcha image is displayed OK on the first page, but it blanks out after a "refresh", a click on a button, or after a "redirect" from other pages.  The RadCaptcha image does not display at all from the remaining 2 pages.

    A work-around is to enable the "Generate New Image" lnk button, but this is kind of strange, making the users generate a new image everytime.

    Can I put RadCaptcha in an .ascx and re-use it?  I do not want to put 3 separate RadCaptcha on 3 separate pages, this would make maintenance a pain.  Is this a correct approach to using RadCaptcha?

    Here my snippet:

     

     

     

    <telerik:RadCaptcha ID="RadCaptcha1" runat="server" ErrorMessage="Enter code below" EnableRefreshImage="true" RegisterWithScriptManager="true"

     

     

     

    ValidationGroup="Group" CaptchaTextBoxLabel="" Font-Size="8pt">

     

     

     

    </telerik:RadCaptcha>

     

     

     

    Thanks for responding.

  2. Answer
    Marin Bratanov
    Admin
    Marin Bratanov avatar
    3600 posts

    Posted 07 Aug 2013 Link to this post

    Hello An,

    There shouldn't be an issue with the captcha image, whether it is in a user control, or directly on the page.
    Blank images can occur in webfarm/webgarden scenarios when they are not properly configured, so I can suggest that you examine the following help article on the matter: http://www.telerik.com/help/aspnet-ajax/captcha-webfarm-and-webgarden.html.
    You can also check with the dev toolbar of the browser whether the requests all return correctly, it is possible that a module like an URL rewriter or proxy is breaking them.


    Regards,
    Marin Bratanov
    Telerik
    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 the blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. An
    An avatar
    23 posts
    Member since:
    Aug 2013

    Posted 14 Aug 2013 Link to this post

    Hi Marin,

    I followed the instructions on the WebFarm/Web Garden article and configured the session to store data to SQL database.  It works perfectly in the test environment but not on the production environment.  If I go directly to the production server, then the RadCaptcha displays initially, but it is grayed out after a server redirect, either on the website itself or from another website.

    I can give you the URL if you want to take a look at.

    Thanks.



  5. Slav
    Admin
    Slav avatar
    1356 posts

    Posted 16 Aug 2013 Link to this post

    Hello An,

    Please ensure that the Session on the production environment is configured as described in the help article that Marin suggested.

    A live URL to your page could be useful for inspecting the problem, as well as the web.config file of your project.

    Regards,
    Slav
    Telerik
    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 the blog feed now.
  6. An
    An avatar
    23 posts
    Member since:
    Aug 2013

    Posted 16 Aug 2013 Link to this post

    Hello Slav,

     

    I did have the ImageStorageLocation set to "Session" as the article suggested.  I also set up the ASPState database and have captured all the hit request.  However, the image is still grayed out after initial hit to the page, as well as any redirect from the website or other website.

    I now am able to get the image to refresh, with OnClientLoad event, so the image now appears everytime. 

    Thanks.

    An
    Site:  https://sbecs.treas.gov

Back to Top
UI for ASP.NET Ajax is Ready for VS 2017