|
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.
|
|
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
|
|
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?
|
|
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!
|
|
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?
|
|
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!
|
|
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?
|
|
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.
|
|