Uploading Images with Image List refresh (Update UpdatePanel)

Feb 5, 2009 at 5:37 PM
Seems there has been a few posts on this. Basically I want to upload Files and have the list of files refresh to show the updated list. I would have though this was a fairly straight forward idea. However there seems to be no documentation on how to do a page refesh or databind when the file upload is complete.

I assumed the onfilereceived would have been the event to use, ie assign a databind on this event. I can assign a throw new exception and nothing happens.
I cannot get this to refresh the list of files after new files have been uploaded.

Here is the code I have been using:


@ Page Language="VB" %>





@ Register Assembly="com.flajaxian.FileUploader" Namespace="com.flajaxian" TagPrefix="cc1" %>






DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">





script runat="server">






Protected Sub Repeater1_Load(ByVal sender As Object, ByVal e As System.EventArgs)




    Dim DI As New System.IO.DirectoryInfo(Server.MapPath("/slideshow/Home/"))



    Dim DT As New System.Data.DataTable()








Dim DR As System.Data.DataRow





For Each FI As System.IO.FileInfo In DI.GetFiles




        DR = DT.NewRow

"FileName") = "/slideshow/Home/" & FI.Name











    Repeater1.DataSource = DT


    DT =





    DR =





    DI =



End Sub




Protected Sub FileUploader1_FileReceived(ByVal sender As Object, ByVal e As com.flajaxian.FileReceivedEventArgs)





End Sub







html xmlns="http://www.w3.org/1999/xhtml">




head runat="server">





<title>Untitled Page</title>










    <form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">








            <asp:UpdatePanel ID="UpdatePanel1" runat="server">






                    <asp:Repeater ID="Repeater1" runat="server" OnLoad="Repeater1_Load">






                            <img alt="" border="0" src='/SlideImage.aspx?W=200&amp;FPath=<%# Eval("FileName") %>'>





<cc1:FileUploader ID="FileUploader1" UseInsideUpdatePanel="true" runat="server" 



                      TransparentBackground="true" onfilereceived="FileUploader1_FileReceived">





                            <cc1:FileSaverAdapter FolderName="slideshow\Home\" />




















Feb 5, 2009 at 5:39 PM
p.s. The formatting is fine in VS2008, I guess codeplex needs to update their wysiwyg editor, it messed up all my formatting.
Feb 6, 2009 at 4:19 PM
Well page refresh when upload is finished is super easy:

function FileStateChanged(uploader, file, httpStatus, isLast){
    Flajaxian.fileStateChanged(uploader, file, httpStatus, isLast);
           document.location.href = document.location.href;

<fjx:FileUploader JsFunc_FileStateChanged="FileStateChanged" runat="server" >
        <fjx:FileSaverAdapter Runat="server" FolderName="UploadFolder" />
Feb 7, 2009 at 3:00 AM
That was absolutely marvelous, I know its more work, but that should be in the documentation, or stickied in the forum. So many people have asked for that, and it would have been a show stopper without it.

Again, thanks a million.