Asyncupload control loses display on button click

4 posts, 0 answers
  1. jophy
    jophy avatar
    4 posts
    Member since:
    Jan 2014

    Posted 11 Feb 2014 Link to this post

     i have a ascx page with a search button which on click shows a panel containing asyncupload control(This panel's visibility is set to false initially). When i upload images for first time, page is working fine.I am able to add images which is uploaded to defined target folder without posting back. Once i click the submit button, files from target folder are processed from code behind. I am able to submit the page perfectly. But, if i click the search button again before submitting, asyncupload control loses its display. Why is this happening? If i reload the page again, control has no display issues.On search button click, i set the panel's (containing upload control) visibility true or false depending on if there's matching data in database. Is this affecting upload control's visibility? Do i have to bind it again or something?  Please help.
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 11 Feb 2014 in reply to jophy Link to this post

    Hi jophy,

    Please have a look into the following sample code snippet which works fine at my end.

    ASCX:
    <telerik:RadButton ID="RadButton1" runat="server" Text="Search" OnClick="RadButton1_Click">
    </telerik:RadButton>
    <asp:Panel ID="Panel1" runat="server" Visible="false">
        <telerik:RadAsyncUpload ID="RadAsyncUplaod1" runat="server" TargetFolder="Uploads"
            PostbackTriggers="RadButton2" OnFileUploaded="RadAsyncUplaod1_FileUploaded">
        </telerik:RadAsyncUpload>
        <telerik:RadButton ID="RadButton2" runat="server" Text="Submit">
        </telerik:RadButton>
    </asp:Panel>

    ASCX.CS :
    protected void RadButton1_Click(object sender, EventArgs e)
    {
            //your condition
            Panel1.Visible = true;
    }
    protected void RadAsyncUplaod1_FileUploaded(object sender, Telerik.Web.UI.FileUploadedEventArgs e)
    {
        Response.Write("Fired");
    }

    Let me know if you have any concern.
    Thanks,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. jophy
    jophy avatar
    4 posts
    Member since:
    Jan 2014

    Posted 12 Feb 2014 in reply to Shinu Link to this post

    I tried postback trigger also. Still it loses display after postback.
    Below is the code snippet. Could you identify anything which I might be missing which prevent control display after postback?

    ​ <tr>
    <td style="vertical-align:top" colspan="1">
    Item Images:
    </td>
    <td>
                      

                          
                           <script type="text/javascript">
    Telerik.Web.UI.RadAsyncUpload.Modules.Flash.isAvailable = function () { return false; }
    Telerik.Web.UI.RadAsyncUpload.Modules.Silverlight.isAvailable = function () { return false; }
    </script>


    <div class="qsf-demo-canvas">
    <%-- In order to store the uploaded files permanently set the TargetFolder property to a valid location. --%>
    <table>
    <tr>
    <td>
    <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server">

    </telerik:RadStyleSheetManager>
    <telerik:RadSkinManager ID="QsfSkinManager" runat="server" ShowChooser="false" />
    <telerik:RadFormDecorator ID="QsfFromDecorator" runat="server" DecoratedControls="All" EnableRoundedCorners="false" />
    <telerik:RadProgressManager runat="server" ID="RadProgressManager1" />
    <telerik:RadAsyncUpload runat="server" ID="AsyncUpload1" MaxFileInputsCount="12" TemporaryFolder="../RadUploadTemp" TargetFolder="../RadUploadTarget" PostbackTriggers="btnSubmit" >
    <FileFilters>
    <telerik:FileFilter Description="Images(jpeg;jpg;gif;png;)" Extensions="jpeg,jpg,gif,png" />
    </FileFilters>
    </telerik:RadAsyncUpload>
    <asp:CustomValidator runat="server" ID="CustomValidator" ValidationGroup="Form" ClientValidationFunction="validation"
    Display="Dynamic" ErrorMessage="Minimum 5 images are required.">
    </asp:CustomValidator>

    </td>

    </tr>
    <tr>
    <telerik:RadProgressArea runat="server" ID="RadProgressArea1" AjaxUrl="Telerik.RadUploadProgressHandler.axd" />

    </tr>

    </table>
    </div>
    </td>

    </tr>
  5. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 12 Feb 2014 in reply to jophy Link to this post

    Hi jophy,

    Unfortunately I couldn't replicate the issue at my end, the given code is working fine for me. Please have a look into the sample project which works as expected.

    Thanks,
    Shinu.
Back to Top