Welcome Guest Search | Active Topics | Sign In | Register

Multiple file Uploader with descriptions for each upload Options
Jamie Miller
Posted: Wednesday, August 26, 2009 4:32:59 AM
Rank: Member
Groups: Member

Joined: 2/6/2009
Posts: 26
Hi,

If I add a textbox to the layouttemplate of an Ajax Uploader control will I be able to access the TextBox for each uploaded file when submitted? Basically I want the user to be able to upload multiple files with a description, so I need a textbox for the description for each upload.

If that makes any sense... is it possible? Has anyone achieved this?

Many thanks.

David.
eo_support
Posted: Wednesday, August 26, 2009 8:41:05 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

Yes. You can access the textbox using code like this:

Code: C#
TextBox tb = (TextBox)AJAXUploader1.FindControl("TextBox1");


Thanks
Jamie Miller
Posted: Wednesday, August 26, 2009 8:45:21 AM
Rank: Member
Groups: Member

Joined: 2/6/2009
Posts: 26
And is it possible to include the text from the textbox in the posted file list?
eo_support
Posted: Wednesday, August 26, 2009 8:50:03 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Unfortunately no. The built-in posted file list is a whole and you can not add any elements to it. Your best option could be build your own file list and associate your textbox with that file list and leave the the uploader only do the uploading.

Thanks!
Jamie Miller
Posted: Wednesday, August 26, 2009 10:11:05 AM
Rank: Member
Groups: Member

Joined: 2/6/2009
Posts: 26
Sounds like a big job? Any pointers as to where I might start with that?
eo_support
Posted: Wednesday, August 26, 2009 10:16:14 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

We are not in a position to advice on the implementations. But it shouldn't be a big job. I would think it's very similar to a regular DataGrid with add/delete/edit. In your case add would be from Uploader, delete is the same, and edit is for your own description.

Thanks!
Jamie Miller
Posted: Wednesday, August 26, 2009 10:26:27 AM
Rank: Member
Groups: Member

Joined: 2/6/2009
Posts: 26
When uploading a file, but before the postback, should the FileUploaded event fire? I'm guessing this is where I need to maintain my file list and update the list on the page? The event only seems to fire when I do a full postback?
eo_support
Posted: Wednesday, August 26, 2009 10:37:47 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
No. FileUpload does not fire until page posts back. Thus you will have to rely on post back to update your list. You can set the uploader's AutoPostBack to true to save user an additional click.


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.