Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > Upload > Added Custom Fields to RadUpload with OnClientAdded loses its value when user enters the wrong RadCaptcha value

Not answered Added Custom Fields to RadUpload with OnClientAdded loses its value when user enters the wrong RadCaptcha value

Feed from this thread
  • sweta avatar

    Posted on Mar 2, 2011 (permalink)


    Hello

    i have added one Add Note' - link button, dropdown box and, 'Remove Note' - link button as Custom fields. when user clicks the 'Add Note' new textarea is displayed.  i have added these fields with OnClientAdded method to the Radupload control. i have RadCaptcha control on my page too. which is above the RadUpload control. when user enters the wrong Captcha value Error message displayed like 'Please Enter Correct word'. so first user enters the captcha value and then selects the file to upload. he adds note and select the value from the dropdown. but as he has entered the wrong captcha value error message is displayed. but the note is disappeared and dropdown box loses its selected value. i'm aware that at this time file selected is lost. and user have to select the file again. its a known limitation of the radupload. but i'm not aware that how the custom field will work.

    Please help me to resolve the issue.

    Thanks
    Sweta

    Reply

  • Genady Sergeev Genady Sergeev admin's avatar

    Posted on Mar 8, 2011 (permalink)

    Hello sweta,

    This happens because RadCaptcha perform a full page postback should the user enters incorrect text. The full page postback will erase the value of RadUpload as well as the additional fields. In order to work that around please place the captcha inside a RadAjaxPanel, so that the upload is not modified should the user enter incorrect text.


    Regards,
    Genady Sergeev
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!

    Reply

  • Posted on Mar 18, 2011 (permalink)

    Hello,
    I am having a similar issue and have tried your suggestions a couple of different ways to no avail. The first scenario, I put the captcha inside an updatepanel with the upload control and submit button outside and it caused validation but caused a full page post-back. I then tried placing the submit button inside the updatepanel, and this caused the desired effect with the captcha, except that since a full page post was not performed the file was not downloaded. Then I tried place all the controls inside the updatepanel, but on a failed captcha validation the upload file was not retained.

    Are these 2 controls not meant to be used together? If they are, please provide an example of how I can use them together.

    Thank you,
    Ryan Overton

    Reply

  • sweta avatar

    Posted on Mar 19, 2011 (permalink)

     

    Hello Ryan,

     

    I have resolved the issue.it is a temporary solution but it worked for me. i have taken the two hidden controls. i fill the value in the hidden control when the page is postback in code-behind file. and i set the value in custom controls when these custom controls are created.

    Thanks
    Sweta

    Reply

  • Genady Sergeev Genady Sergeev admin's avatar

    Posted on Mar 24, 2011 (permalink)

    Hi Ryan Overton,

    RadUpload and RadCaptcha are not compatible in the scenario that you have tried. In such cases, I suggest that you use RadAsyncUpload instead (which is capable of uploading files with Ajax). Example:

    <form id="form1" runat="server">
        <asp:ScriptManager runat="server" ID="ScriptManager1">
        </asp:ScriptManager>
        <div>
            <asp:UpdatePanel runat="server" ID="UpdatePanel1">
                <ContentTemplate>
                    <asp:ValidationSummary ID="ValidationSummary1" runat="server" ValidationGroup="SubmitInfo"
                        EnableClientScript="False" />
                    <asp:Button runat="server" ID="Button1" Text="Postback" CausesValidation="true" ValidationGroup="SubmitInfo" />
                    <telerik:RadCaptcha ID="RadCaptcha1" runat="server" ErrorMessage="Page not valid. The code you entered is not valid."
                        ValidationGroup="SubmitInfo">
                    </telerik:RadCaptcha>
                    <telerik:RadAsyncUpload runat="server" ID="RadAsyncUpload1">
                    </telerik:RadAsyncUpload>
                    </div>
                </ContentTemplate>
            </asp:Update


    Best wishes,
    Genady Sergeev
    the Telerik team

    Reply

  • MJ avatar

    Posted on Jan 25, 2012 (permalink)

    Hi Sweta,

    I am also using the work around similar to yours regarding the custom controls added to the Rad uplaod.
    Where are the custom controls created? I am trying to set the values of the custom controls in OnClientAdded inside the script.
    Are you able to set the value for FileUpload control using the hidden field value

    Regards,
    MJ

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > Upload > Added Custom Fields to RadUpload with OnClientAdded loses its value when user enters the wrong RadCaptcha value
Related resources for "Added Custom Fields to RadUpload with OnClientAdded loses its value when user enters the wrong RadCaptcha value"

ASP.NET Upload Features  |  Documentation  |  Demos  |  Telerik TV  |  Self-Paced Trainer  |  Step-by-step Tutorial  ]