Problem and Solutions

0

Like

FileUpload control inside UpdatePanel is not working


Hi Friends

I am using FileUpload control inside UpdatePanel but it is not working.

Could anyone please give me some solution, how to use FileUpload Control inside UpdatePanel.

I am using asp.net and C#

Thanks in advance.
Regards
Sam
Posted by: Sam
On 31 Jul 2012 | Views: 3211 | Categories: ASP.NET, AJAX
Solutions(4)
 On 31 Jul 2012 01:48:14 PM
Hi Sam

Simple FileUpload control does not work inside UpdatePanel, if you want to use file upload in ajax then you should use AsyncFileUpload control of Ajax Toolkit.

I hope it will be useful.

Regards
Teena
 On 31 Jul 2012 02:47:42 PM
Hi

We can also use PostBackTrigger of UpdatePanel to work FileUpload Control in AJAX UpdatePanel

Example:

<asp:UpdatePanel ID="upFileUpload" runat="server">

<ContentTemplate >

// Place file upload file control here

</ContentTemplate>

<Triggers>

<asp:PostBackTrigger ControlID="btnUpload" />

</Triggers>

</asp:UpdatePanel>


I hope it will work

Regards
Micle
 On 10 Aug 2012 01:36:56 PM
Hi

We can also use jQuery to upload file.

Here is a code example:

<script type="text/javascript" src="Scripts/jquery-1.4.1.min.js"></script>
<script type="text/javascript" src="Scripts/jquery.form.js"></script>

<script type="text/javascript">
$("#Form1").ajaxForm({
success: function (response) {
$('#updateFileDiv').append(response);
}
});
</script>


HTML:

<form id="Form1" action="http://localhost/uploadfile.aspx" method="post"
enctype="multipart/form-data">
<div id="updateFileDiv" runat="server">
</div>
<div>
<input type="file" id="myfile" name="myfile" value="" />

<input type="submit" value="Upload" />
</div>
</form>

Now you will have to handle the form submission in your code-behind and send back the response.

I hope it will be useful :)
 On 26 Mar 2014 02:31:32 PM
You must set this property in the updatepanel UpdateMode = "conditional"

More details on this link

http://www.systemdeveloper.info/2014/01/fileupload-control-in-update-panel.html
Post your Solutions  

 

Other lins

.Net Techies
Other lins