r.a.d.controls version |
RadUpload 1.0.3 +
|
.NET version |
1.x, 2.x
|
Visual Studio version |
Visual Studio 2003, 2005
|
programming language |
JavaScript
|
browser support |
all browsers supported by r.a.d.controls
|
I wanted to share a script I wrote to keep RadUploadProgressArea centered while a large file is being uploaded.
For some reason, I haven't been able to tame the upload progress box. It appears in random places on our pages. If you can't see it, you don't even know if a file upload is taking place.
The attached script is invoked every time a chunk is transmitted. You can include it on a page directly or, better yet, move it to a separate JavaScript file and link to it so it gets cached (<script src="./CenterUploadArea.js"></script>).
To get it to work, you need to initialize the OnClientProgressUpdating property of a RadUploadProgressArea control instance:
RadUploadProgressArea1.OnClientProgressUpdating = "CenterUploadArea";
Remember to also wire RadUploadHttpModule in web.config:
<httpModules>
<add name="RadUploadModule"
type="Telerik.WebControls.RadUploadHttpModule, RadUpload.Net2"/>
</httpModules>
With this setup, even if you scroll the browser window during a file upload, the progress area will get centered.