SlickUpload
Welcome Guest Search | Active Topics | Log In | Register

Add a Description Textbox Next to every file Options
anthony.selby
#1 Posted : Monday, November 28, 2011 2:26:49 PM
Rank: Newbie

Groups: Registered

Joined: 11/28/2011
Posts: 9

Is there an easy way to add a text box that next to the file name (after its been selected) to all the user to enter a brief description ?

 

then I need to be able to get that info in the uploadcomplete event ?

 

Thanks again

Axosoft
#2 Posted : Monday, November 28, 2011 2:40:51 PM
Rank: Administration


Groups: Administrators

Joined: 7/7/2005
Posts: 1,586
Location: Scottsdale, AZ

Sure. Add an <input type="text" /> or <textarea></textarea> to the <FileItemTemplate> template. SlickUpload replicates this template in the FileList for each file that is selected. Give the <input> an id and name, and you can use this to access it server side.

Something like:

<FileItemTemplate>                          
    <kw:FileListElement Element="FileName" runat="server"/>
    &ndash;
    <kw:FileListElement Element="FileSize" runat="server">(calculating)</kw:FileListElement>
    <kw:FileListRemoveCommand runat="server" href="javascript:;">[x]</kw:FileListRemoveCommand>
    <kw:FileListElement Element="ValidationMessage" runat="server" style="color:#f00"/>
    <p>Description: <input type="text" id="description" name="description" /></p>
</FileItemTemplate>

Server side, you can access this value as you're looping through the UploadedFiles collection, like this:

        foreach (UploadedFile file in e.UploadedFiles)
        {
            string description = file.Data["description"];
 
            // TODO: do something with description
        }

 

Users browsing this topic
Guest
Forum Jump  
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.