RadCaptcha is refreshing in updatepanel controls with AsyncPostBackTrigger

9 posts, 0 answers
  1. Thenmozhi
    Thenmozhi avatar
    26 posts
    Member since:
    May 2009

    Posted 24 Dec 2010 Link to this post

    Hi ,

    I have 2 asp .net Dropdowns Country and state with autopostback=true.

    I have added controls in asp .net update panel with content template.

    As like below...

     <asp:UpdatePanel ID="updateapnel1" runat="server">
        <Triggers>
        <asp:AsyncPostBackTrigger ControlID="ddlcountry" EventName="SelectedIndexChanged" />
        <asp:AsyncPostBackTrigger ControlID="ddlstate" EventName="SelectedIndexChanged" />    
        </Triggers>
           <ContentTemplate>
    Controls are here [Have a Rad captcha in this form]
    </ContentTemplate>
     </asp:UpdatePanel>

    Getting New images during the item selection change in dropdown...

    can you please tell how to eliminate the rad capcha refresh...

    Thanks in advance..
    Thenmozhi.R
  2. Pero
    Admin
    Pero avatar
    1156 posts

    Posted 24 Dec 2010 Link to this post

    Hello Thenmozhi,

    The RadCaptcha control is designed to refresh its code on every trip to the server regardless of the type of the Request, postback or ajax call. This is so due to security reasons.

    Greetings,
    Pero
    the Telerik team
    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Thenmozhi
    Thenmozhi avatar
    26 posts
    Member since:
    May 2009

    Posted 24 Dec 2010 Link to this post

    Thanks for your immidiate response..

    I solved the issue as like below..

    I have placed the capcha control outside the update panel..

    And checking in button click RadCaptcha1.IsValid() if it is true than i am allowing user to save the details.

    Please suggest me anywhere wrong...
  5. Pero
    Admin
    Pero avatar
    1156 posts

    Posted 24 Dec 2010 Link to this post

    Hello Thenmozhi,

    Placing the RadCaptcha control outside the UpdatePanel would not resolve the issue, because the Captcha code will be changed, but will not be displayed on the image. So, even if the user enters the code she/he sees on the picture, the RadCaptcha will always return false because the code has changed after the ajax request.
    So, I would suggest placing the RadCaptcha inside the UpdatePanel.

    Greetings,
    Pero
    the Telerik team
    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
  6. Thenmozhi
    Thenmozhi avatar
    26 posts
    Member since:
    May 2009

    Posted 24 Dec 2010 Link to this post

    Actually my testing team not accepting the refreshment of the image in radcaptcha in each item change.

    could you suggest any implementation method to resolve this issue please..
  7. Pero
    Admin
    Pero avatar
    1156 posts

    Posted 24 Dec 2010 Link to this post

    Hi Thenmozhi,

    There is no straight forward way to override the default behavior of the RadCaptcha control, when it comes to refreshing its text code.
    The only way would be to create a custom HttpHandler to serve the CaptchaImage. We have a sample that demonstrates how to this. Please find it attached to the thread. I have modified the code so that the RadCaptcha always renders the same code. You could easily implement your own condition for generating CAPTCHA codes.

    Greetings,
    Pero
    the Telerik team
    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
  8. Thenmozhi
    Thenmozhi avatar
    26 posts
    Member since:
    May 2009

    Posted 24 Dec 2010 Link to this post

    Thanks a lot..

    Your solution solved my issue..

    Thanks for your quick responses.

    My Heartiest wishes for this Christmas...

    Advance Happy New Year :)
  9. Thenmozhi
    Thenmozhi avatar
    26 posts
    Member since:
    May 2009

    Posted 27 Dec 2010 Link to this post

    Hi ,

    Sorry to dist rub you again..

    Your solution is worked fine in my local.

    After deploying the site it is not showing the image.

    Showing the below text

    This is captcha image

    My application has the separate app pool with .net frame work 4.0.

    Our server has both the .net and telerik installed.

    Please suggest me how to proceed with this..

  10. Lini
    Admin
    Lini avatar
    2144 posts

    Posted 30 Dec 2010 Link to this post

    Hello,

    Make sure that you have added the custom captcha handler to both the <system.web> and <system.webServer> sections of the web.Config file for your web application. This will ensure that the handler will work both in development and production. For example:

    <system.web>
        <httpHandlers>
            <add verb="*" path="MyCustom.CaptchaHandler.axd" type="CustomNameSpace.CaptchaImageHandler"/>
        </httpHandlers>
    </system.web>
    <system.webServer>
        <handlers>
            <add name="MyCustom_CaptchaHandler_axd" verb="*" preCondition="integratedMode" path="MyCustom.CaptchaHandler.axd" type="CustomNameSpace.CaptchaImageHandler"/>
        </handlers>
    </system.webServer>


    Kind regards,
    Lini
    the Telerik team
    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017