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

Thread is closed for posting
6 posts, 0 answers
  1. sweta
    sweta avatar
    21 posts
    Member since:
    Jun 2010

    Posted 02 Mar 2011 Link to this post


    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.

  2. Genady Sergeev
    Genady Sergeev avatar
    1595 posts

    Posted 08 Mar 2011 Link to this post

    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.

    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!
  3. DevCraft R3 2016 release webinar banner
  4. Ryan Overton
    Ryan Overton avatar
    12 posts
    Member since:
    Oct 2009

    Posted 18 Mar 2011 Link to this post

    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
  5. sweta
    sweta avatar
    21 posts
    Member since:
    Jun 2010

    Posted 19 Mar 2011 Link to this post


    Hello Ryan,


    I have resolved the 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.


  6. Genady Sergeev
    Genady Sergeev avatar
    1595 posts

    Posted 24 Mar 2011 Link to this post

    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:UpdatePanel runat="server" ID="UpdatePanel1">
                    <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."
                    <telerik:RadAsyncUpload runat="server" ID="RadAsyncUpload1">

    Best wishes,
    Genady Sergeev
    the Telerik team
  7. MJ
    MJ avatar
    1 posts
    Member since:
    Jan 2012

    Posted 25 Jan 2012 Link to this post

    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

Back to Top
DevCraft R3 2016 release webinar banner