Returning data back to the server page

Jan 22, 2009 at 9:29 AM
Edited Jan 22, 2009 at 9:44 AM
I need to send the list of the file names back to the server page after all files have been uploaded, I can only think of using a session variable to achieve this:

        void fileUpload_FileUploadCompleted(object sender, FileUploadCompletedEventArgs args)
        {
           
            FileInfo fi = new FileInfo(args.FilePath);
            ctx.Session["FileList"] += System.IO.Path.GetFileName(fi.Name) + ", ";
          
        }

Is there a better way to do this? It would be better if I can use the ArrayList() instead.

By the way, shouldn't there be an event handler when all files have been uploaded?

Tony

Jan 22, 2009 at 1:53 PM
I believe you can put an ArrayList in the session:

ArrayLIst fileList = ctx.Session["FileList"] as ArrayList;
if(fileList == null)
fileList = new ArrayList();
fileList.Add(System.IO.Path.GetFileName(fi.Name));

ctx.Session["FileList"] = fileList;

Hope this works,
Darick




From: [email removed]
To: [email removed]
Date: Thu, 22 Jan 2009 01:29:51 -0800
Subject: Returning data back to the server page [SilverlightFileUpld:44900]


From: tonyctlu
I need to send the list of the file names back to the server page after all files have been uploaded, I can only think of using a session variable to achieve this:

void fileUpload_FileUploadCompleted(object sender, FileUploadCompletedEventArgs args)
{

FileInfo fi = new FileInfo(args.FilePath);
ctx.Session["FileList"] += System.IO.Path.GetFileName(fi.Name) + ", ";

}

Is there a better way to do this? It would be better if I can use the ArrayList() instead.

Tony
Read the full discussion online.
To add a post to this discussion, reply to this email (SilverlightFileUpld@discussions.codeplex.com)
To start a new discussion for this project, email SilverlightFileUpld@discussions.codeplex.com
You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.
Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com


Hotmail® goes where you go. On a PC, on the Web, on your phone. See how.