Uploader on a page with a datagrid

Last post 03-09-2011, 2:26 PM by johansec. 1 replies.
Sort Posts: Previous Next
  •  03-09-2011, 12:45 PM 66601

    Uploader on a page with a datagrid

    I have a page with a datagrid.  I need an upload button in each row.  I don't want 50 copies of the control on the page.
     
    I would like to put one uploader on the page and have a plain button in each row that uses javascript to call the "browse" or whatever method it is that opens the file browse window so the user can select a file and upload it.
     
    I know there are clientside javascript event handlers, are there also clientside javascript methods that can be called?
  •  03-09-2011, 2:26 PM 66603 in reply to 66601

    Re: Uploader on a page with a datagrid

    I figured this out on my own.  The buttons in my datagrid call the following function, supplying it with the row specific parameter which is used on the server side to store the document in the proper place in the database.  
     
    It was necessary for me to view the source code to find the client id of the Uploader1_Insert control component and to set the uploader UploadType to "IFrame".
     
    function DisplayUpload(RequestID) {
       document.getElementById("<%=hdnRequestID.ClientID%>").value = RequestID;
       document.getElementById(
    "ctl00_ContentPlaceHolder1_Uploader1__Insert").click();
    }
View as RSS news feed in XML