ASP.NET - updating a label asynchronously - help!!

Get help on web editors (Frontpage, Dreamweaver) and web languages (HTML, ASP, PHP).
Post Reply
shiv
Registered User
Posts: 497
Joined: 26 Mar 2007, 02:00
Contact:

ASP.NET - updating a label asynchronously - help!!

Post by shiv »

I've googled a lot and didn't find a solution that works for me.
Maybe you guys can help me out.

I have an ASP.NET app.
There's an Upload form to upload files.
When the Submit button is clicked, I want a label to be displayed showing the progress of the uploads.
Something like "Uploading file x of y...".

What exactly happens when the Submit button is clicked is:
(1) Looping through an HTTPFileCollection (that's where the x and y values are found).
(2) Doing a few checks to see if the files are acceptable.
(3) Calling an Oracle stored procedure to do the writing to the database.

I've gone through lots of code snippets on the net, nothing seems to work.
If lblProgress.Text just worked, it would be great, but things don't work that way!

Any help is greatly appreciated!!! :(
Hex_Rated
Registered User
Posts: 3679
Joined: 19 Jan 2006, 02:00
Contact:

Re: ASP.NET - updating a label asynchronously - help!!

Post by Hex_Rated »

You need to refresh the page to get it to update. Or set autopostback property to true, but this will cause a flicker on your webpage.
DFI LanParty X48 LT-2TR
Intel Q9450 @ 3.2Ghz
Dell 24" 2408WFP | Phillips 37" 1080p
Sapphire HD4870 X2 2GB
4GB Corsair DDR-2 1066 | Thermalrite 120 Ultra Extreme | G9 Mouse | G15 Keyboard
Vista Ultimate x64
Kronos
Moderator Emeritus
Posts: 4280
Joined: 28 May 2003, 02:00
Location: Azeroth
Contact:

Re: ASP.NET - updating a label asynchronously - help!!

Post by Kronos »

Are you using AJAX?
Image
shiv
Registered User
Posts: 497
Joined: 26 Mar 2007, 02:00
Contact:

Re: ASP.NET - updating a label asynchronously - help!!

Post by shiv »

Kronos wrote:Are you using AJAX?
nope
shiv
Registered User
Posts: 497
Joined: 26 Mar 2007, 02:00
Contact:

Re: ASP.NET - updating a label asynchronously - help!!

Post by shiv »

shiv wrote:
Kronos wrote:Are you using AJAX?
nope
Sorry yes I am using Ajax
Kronos
Moderator Emeritus
Posts: 4280
Joined: 28 May 2003, 02:00
Location: Azeroth
Contact:

Re: ASP.NET - updating a label asynchronously - help!!

Post by Kronos »

The I'll first assume that you're using an updatepanel? at least for the Upload Area?

I can't remember exact details but try to search more about Callbacks for ajax, whereby you can make the panel update to get the latest details.
You can perhaps make the updatepanel request a status from the server regarding the file upload, and if anything has changed, update the panel, or, if not, do nothing.
Image
Post Reply