Progress bar web form file.add BEGINNER

C

cindy

I cannot see how to use progressbar when I programmatically add file to
Windows SharePoint Services document library
Code that adds file

SPWeb site;
FileInfo TheFile = new FileInfo(StrFullFileName);
FileStream fStream = File.OpenRead(StrFullFileName);
byte[] contents = new byte[fStream.Length];
fStream.Read(contents, 0, (int)fStream.Length);
fStream.Close();
finalurl = desturl + StrFileName;
site = new SPSite(finalurl).OpenWeb();
SPFile myfile = site.Files.Add(finalurl,contents);

the file is large and i want progress bar for user to see how much progress
to end. Is there a progressbar web control? How do I tell control to start
and end with site.Files.Add(finalurl,contents) progress? The reason I am
doing this is I can't figure out how to prevent any user interactions with
the form until the file uploads (like close it) so I at least want to show
progress of adding file. Then form closes after file add is done.
 
R

Rob R. Ainscough

That's a pretty common question, a very easy task for a Windows Form apps,
but very worky for a web apps -- the easiest solution is to display an
animated gif (or some other animation) to let them know it is thinking, when
done make the gif not visible -- that way you only render the page twice
(once for starting and once for stopping).

There are other methods but they require a lot more work. What you need is
client side rendering with server side updates -- good luck.
 
W

Walter Wang [MSFT]

Hi cindy,

Thank you for post!

Besides Rob's suggestion, you can take a look at following article:

#Build a Dynamic Progress Page for ASP.NET Pages
http://www.eggheadcafe.com/articles/20050108.asp


Regards,
Walter Wang
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top