What you want to see on DotNetFunda.com ?
DotNetFunda.Com Logo
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 8907 |  Welcome, Guest!   Register  Login
 Home > Forums > ASP.NET AJAX > Problem with FileUpload control ...
Samirg

Problem with FileUpload control

Replies: 5 | Posted by: Samirg on 10/12/2012 | Category: ASP.NET AJAX Forums | Views: 591 | Status: [Member] | Points: 10  


Hi All,

I have a situation where I have a Asp.Net FileUpload control and a Button control on the page. There is also a UpdatePanel on the page which encloses some div tags. The problem is that whenever user clicks the button, the page posts back and the FileUpload control loses all the information. Below is the code for the same,

<div id="fileLoadProgress" class="slidingPanel" style="">

<asp:FileUpload ID="FileUploader" runat="server" />
<asp:Button ID="btnUpload" runat="server" Text="Upload" Height="20px" OnClick="btnUpload_Click" />
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div>
<table cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left">
<div id="progressbar" style="width: 250px; height: 18px;">
</div>
</td>
<td>
<div id="dvProgressPrcent">
0%
</div>
</td>
<td>
<div id="infoBar">
</div>
</td>
</tr>
</table>
</div>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="btnUpload" EventName="Click" />
</Triggers>
</asp:UpdatePanel>


I have gone through some articles on internet which stated that FileUpload control is not compatible with UpdatePanel and requires full postback. However my requirement doesn't permit me to do a full postback.

I came across one article which says that enclosing the FileUpload control and the Button in an iFrame can do the job.

However I have a doubt that how this can be done and if I implement it in that way, how can I then update the div tags which are present in the UpdatePanel. How will I be able to link the controls on main page to the controls on iFrame?

Thanks in advance.


Reply | Reply with attachment | Alert Moderator

 Responses below this adGet hundreds of .NET Tips and Tricks videos

 Replies

Bageshkumarbagi
Bageshkumarbagi  
Posted on: 10/14/2012 2:12:29 AM
Level: Starter | Status: [Member] | Points: 25

hi Samirg
for using any ajax control fiest you need to take ScriptManager.then only your UpdatePanel will be work.

<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>

Samirg, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Bageshkumarbagi
Bageshkumarbagi  
Posted on: 10/14/2012 2:14:22 AM
Level: Starter | Status: [Member] | Points: 25

if your program executed successfully then Mark as answer.

Samirg, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Vinay13mar
Vinay13mar  
Posted on: 10/14/2012 10:37:24 AM
Level: Starter | Status: [Member] | Points: 25

Samirg, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Samirg
Samirg  
Posted on: 10/15/2012 4:54:46 AM
Level: Starter | Status: [Member] | Points: 25

Hi Bagesh, I have the script manager on my aspx page, though it is not shown here in the code...

Samirg, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Samirg
Samirg  
Posted on: 10/15/2012 4:56:46 AM
Level: Starter | Status: [Member] | Points: 25

@Vinay, Thanks for the link. I read the article you had suggested but that is not the functionality I am expecting. I want to show the progress bar in real time as the file uploads without making any postback.

Samirg, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Reply - Please login to reply


Click here to login & reply

Found interesting? Add this to:


 Latest Posts

Write New Post | More ...

About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you find plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 5/26/2013 3:02:45 AM