Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Progress bar web form file.add BEGINNER

Reply
Thread Tools

Progress bar web form file.add BEGINNER

 
 
cindy
Guest
Posts: n/a
 
      05-23-2006
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.
--
cindy
 
Reply With Quote
 
 
 
 
Rob R. Ainscough
Guest
Posts: n/a
 
      05-24-2006
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.



"cindy" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>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.
> --
> cindy



 
Reply With Quote
 
 
 
 
Walter Wang [MSFT]
Guest
Posts: n/a
 
      05-24-2006

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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Progress bar to show the progress of a task Charlie Zhang Java 3 08-16-2004 05:53 PM
Web Form Progress Bar aj ASP .Net 4 08-19-2003 02:43 PM
Re: Web Form Progress Bar Ivan Demkovitch ASP .Net 1 08-19-2003 02:41 PM
Re: Web Form Progress Bar Steve C. Orr, MCSD ASP .Net 0 08-13-2003 05:26 PM
progress bar or guage bar Rob ASP General 6 07-12-2003 09:46 AM



Advertisments