Welcome Guest Search | Active Topics | Sign In | Register

AJAXUploader Delayed PostBack - Empty PostedFiles Collection Options
Trick
Posted: Wednesday, July 16, 2008 8:07:25 AM
Rank: Member
Groups: Member

Joined: 8/9/2007
Posts: 18
Hi EO,

I'm having a little issue with the AJAXUploader, where the PostedFiles collection is empty if autopostback="false".

It seems to be the same on the Live Demo for "Delayed PostBack" (collection length is also returning zero).

Can you let me know if I'm going mad, or if there's a fix available please? As always I'll happily test a beta version if needed :)

Regards,

Richard.
eo_support
Posted: Wednesday, July 16, 2008 8:19:40 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,097
Hi Richard,

PostedFiles are automatically cleared after FileUploaded event (it should not have, we will need to fix this), so if you handle the uploader's FileUploaded event, you should have all the files.

Another option is to use a separate AJAXPostedFileList control:

http://www.essentialobjects.com/ViewDoc.aspx?t=EO.Web.AJAXPostedFileList.html

That control keeps the full file list all the time.

We will let you know as soon as the first issue is fixed.

Thanks!
Trick
Posted: Wednesday, July 16, 2008 8:38:09 AM
Rank: Member
Groups: Member

Joined: 8/9/2007
Posts: 18
Ok cool, I've worked around it for now as follows:

Code: Visual Basic.NET
Private attFile As EO.Web.AJAXPostedFile

Private Sub updDocument_FileUploaded(ByVal sender As Object, ByVal e As System.EventArgs) Handles updDocument.FileUploaded
    If updDocument.PostedFiles.Length > 0 Then attFile = updDocument.PostedFiles(updDocument.PostedFiles.Length - 1)
End Sub

Private Sub cmdAddAttachment_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmdAddAttachment.Click
    'Access attFile Here
End Sub


...so no hurry on the fix ;)

Regards,

Richard.


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.