Performing File Upload using update panel and update progress

 Hi guys

I'm totally new to ajax, and Im using vs2005 and ajax 1 with .net 2.0

I've created a form for my application that allows a user to upload a file to a database. The form contains a fileupload, a button (that invokes the insert) and a repeater that lists all the files currently stored. This works great.

Now I want to use ajax to display an 'uploading...' message and animation to displaye while the file is being uploaded. Depending on the file, uploading can take quite a while, and I wanted to include some feedback to the user to let them know what's happening. I've gone through the ajax tutorial videos on getting started and using update panels etc, as well as on the update progress feature. I cnat seem to get it to work.

I first placed the repeater inside the update panel, and set up a trigger for my upload button. This didnt work. I've tried including all my controls inside the update panel, some in some out, and a few different combinations. Files are no longer uploading, (when I'm including update panels) and the update progress does nothing.

Can anyone give me a few pointers on where I should be placing the update panel, and which of my controls should go inside for both my normal functionality and my progress to work properly.

Thanks in advance

1/18/2008 11:48:30 AM 13973 articles. 0 followers. Follow

4 Replies

Similar Articles

[PageSpeed] 11

You're not going to be able to do that easily.  The only way to provide async file uploads is to put the upload element in an iframe.  Unless you use a PostbackTrigger to force a full postback, it won't work in an UpdatePanel, by design.

Encosia - ASP.NET, AJAX, and more.

Latest article: Using complex types to make calling services less… complex
1/18/2008 2:28:23 PM

 thanks for your reply. I've already applied a Postback trigger, which of course allows the upload, but takes away the functionality of the aysnc postback and the update prorgress. This means I may as well stick with what I had before. All I really want is some feedback while the file is being uploaded. Clearly it's not as simple as I thought!!! Thanks for the link, that was helpful. How would I go about using an iframe in the manner you mention? Thanks

1/18/2008 2:42:00 PM

You just place the upload element in an iframe that's sized to inconspicuously contain it.  So, then it appears that the upload happens asynchronously.

However, that method won't get you any closer to an upload progress indicator, unfortunately.   

Encosia - ASP.NET, AJAX, and more.

Latest article: Using complex types to make calling services less… complex
1/18/2008 3:14:36 PM

 ah right, thanks anyway

1/18/2008 3:20:44 PM

Similar Artilces:

Performance Question?
Hi, I've created 2 menus by using datalist controls via sql server 2000 tables in separate user controls. However in each user control, I'm opening and closing the connection for the sql server 2000 and also in the page content as well. So actually the connection is being opened and closed 3 times for a particular page. Is this ok when concerened with performance and memory usage?  Regards,::: Hifni Shahzard Nazeer M. :::---- "If I have seen further, it is by standing upon the shoulders of giants" - Sir Isaac Newton ----- You should load the data once on page load and...

Timeout error using Database blocks
System.InvalidOperationException: Timeout expired.  The timeout period elapsed prior to obtaining a connection from the pool.  This may have occurred because all pooled connections were in use and max pool size was reached ---Here is the code-----   {            string connectionstring = ConfigurationManager.ConnectionStrings["CWGCartConnectionString"].ToString();            SqlDataReader reader1 = null;         ...

Detecting Progressive JPG's Uploaded
I need to know when a JPG file is uploaded whether or not it is a progressive (multi-pass) JPG or not, and then, if it IS progressive, to save the file as a non-progressive JPG. The contenttype property (myFile.PostedFile.ContentType) always returns "image/pjpeg" even when the file is not a progressive jpg. Anyone have a simple (or not-so-simple) solution? Like maybe opening the file as a stream and analyzing it or something? I don't really know where to start on this. Thanks in advance! ...

performance: standalone, isapi or aspx
Hello, I would like to take a doubt in deployment intraweb as stadalone, ISAPI and aspx which of these has better performance. Made an application for inscription of a selective to a school using the standalone, I simultanios 220 user access and it worked well. only wanted to use the ISS is best to administer since I have several applications I have no doubt about the performance of ISAPI and ASPX. -- Benilton Ramos > {quote:title=Benilton Ramos Santos wrote:}{quote} > Hello, I would like to take a doubt in deployment intraweb as stadalone, ISAPI and aspx which of these has better p...

Controllers, why not use shared functions?
Why is it that DNN did't made the functions in the controller classes Shared? IMO it should not be necessary to create a controller instance befor I can communicate with my dataprovider. For example; to retrieve all portal roles now, I should do this: Dim roleCtrl As new RoleController Dim roles As Arraylist = roleCtrl .GetPortalRoles(PortalID) But if they had made the GetPortalRoles Shared, I would not have to create a new RoleController instance first. The code would be: Dim roles As Arraylist = RoleController.GetPortalRoles(PortalID) Great question. Looking at the co...

How do you put a title on a page when using masterpages?
I'm using masterpages. When a user is view my application the tab is "untitled" is there a way to put a title on different pages?  When I try I get an error "only contents are allowed on content pages" You should add the page title in the @Page section (the first line of the file) <%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"    CodeFile="Default.aspx.cs" Inherits="Default" Title="Here is my page title" %> ...

error while running execute file of powerbulider 6.0.00
! Hi everyone I Create Execute File With PowerBuilder Version 6.0.00, And Connect To DataBase With Sybase SQL Anywhere 5.0. When I Try To Run The Execute File I Get The Message "DBMS ODBC is not supported in your current installation". i can run my application with powerbuilder, but not with the execute file i already have the PBODB60.DLL intalled in my computer and the client for asa to. .Please Help Thanks. david Those are the only reasons why you would get that specific message IME. Are you sure that the PBODB60.DLL is on the path? Are you sure that t...

More work on MDN: FxOS developer settings, and Web App performance articles
Hi all, I have been keeping myself busy this week. Can I get a review/sanity = check on these? 1. I=92ve updated the Firefox OS developer settings page to be current = for v1.4: = s 2. I=92ve taken all of the rather disparate web apps performance = material we have flung all over the place, and produced something more = coherent: There is a lot more that will need adding here, so suggestions are = welcome. Best regards, Chris...

Load pbl Files in Powerbuilder 11
I have inherited a PowerBuilder 7 application, and I am trying to load it in V11. All I have are 4 .pbl files, which do not open in V11. Any ideas. Thank You. First, make a backup copy of your .pbl files. In PB11 use the New wizard and choose Existing Application from the Target tab. It will migrate the libraries to PB11 format. <Steven> wrote in message >I have inherited a PowerBuilder 7 application, and I am > trying to load it in V11. All I have are 4 .pbl files, > which do not open in V11. Any ideas. Thank You....

Performance problems with Select Max going from 11.5
We just recently upgraded a client from 11.5 to 12.0(EBF9271). The new server has more of everything(ram, 7 550mhz etc). After the updgrade we ran update statistics on all the tables. We also changed some of the tables to row level locking(which did help performance). Yet we have on issue that we still cannot figure out. In one application a Select Max is being used. Under 11.5 this SQL statement runs VERY fast. After the upgrade to 12.0 this runs VERY slow causes the application to crawl in a certain location. Here is the query: Select max(b.activityid) from activity...

Improve Intel GM45 performance in Xorg
Hi everybody. :shame: I'm having this issue since I buy my Pavilion DV5-1143LA, and here is: The performance of my Graphics in Linux its just terrible. I don't use glxgears as my benchmark because its not really accurate, so I'm using the TuxRacer game that also works on Windows. So, on Win I have a solid 55 FPS, while in Linux only 10 FPS ... The difference its from heaven to earth. This was on 11.1 with the "intel" driver. I thought that with 11.2 and a new kernel, and a new Xorg, and a new Mesa, and just a new everything this will get better, at l...

Monitoring software being installed on performance test machines
This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --425Rl06E0qFj6mmMT9W9cKhRFp5Vosime Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable tl:dr: We recently installed system monitoring software on our buildbot masters, build-not-test slaves, and various other RelEng machines. IT want to continue this rollout, deploying monitoring software onto RelEng production test machines, which raises a concern about possible impact to performance numbers. If you see any production impact, please let us know. =3D=3D=3D=3D=3D=3D We are being ask...

How to tell if a file is still open for writing by another process
I want to write a routine to be run as a scheduled task in Windows which will examine a set of PDF files in a directory and when one is updated (i.e. overwritten by a more recent version) will write the file to a web server. I am unsure about the possibility of a conflict if a file in this directory is in the process of being created/written. The file in question will be a PDF written from an Excel workbook. I will want to make sure the file writing has been completed by Excel, I'm not sure if there is any way to tell if a file is not yet written and closed and available f...

Sorting data when using an ObjectDatasource
How do you sort data when using an ObjectDatasource? I have a Gridview and a ObjectDatasource in an webpage. The sorting work and the gridview talks to the ObjectDatasource without any code. But If I add a button to do the sort, lets say to sort by State, how do you do this?Do you use the SortParameterName property of the ObjectDatasource, if so how? Thanks Here is the sample code :  CODE Behind public partial class Sort : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { }     protected void Button1_Click(object sender, Ev...

Download audio/video file
  Which .net objects download audio/video file(if downloadable) from web by providing url, other then HttpWebRequest?Anyone have code example about download audio/video file?   System.Net.WebClient wc = new System.Net.WebClient(); wc.DownloadFile(new Uri(link), filepath); resolved... ...