This is a migrated thread and some comments may be shown as answers.

Asyncupload control loses display on button click

3 Answers 53 Views
AsyncUpload
This is a migrated thread and some comments may be shown as answers.
jophy
Top achievements
Rank 1
jophy asked on 11 Feb 2014, 05:13 PM
 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.

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 12 Feb 2014, 05:01 AM
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.
0
jophy
Top achievements
Rank 1
answered on 12 Feb 2014, 10:32 PM
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>
0
Shinu
Top achievements
Rank 2
answered on 13 Feb 2014, 03:35 AM
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.
Tags
AsyncUpload
Asked by
jophy
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
jophy
Top achievements
Rank 1
Share this question
or