Re: Adding webforn value to upload name

  •  02-20-2014, 8:40 AM

    Re: Adding webforn value to upload name

    Hi TimBall,

     

    Please try the example below, it shows you how to achieve it. You can get the select value from the dropdown list and use in the FileUploaded event with the save file name.

     

    1. <%@ Page Language="C#" AutoEventWireup="True" %>  
    2.   
    3. <%@ Register Assembly="CuteWebUI.AjaxUploader" Namespace="CuteWebUI" TagPrefix="ajaxuploader" %>  
    4. <html>  
    5. <head>  
    6.     <script runat="server">  
    7.         protected void uploader1_FileUploaded(object sender, UploaderEventArgs args)  
    8.         {  
    9.             args.CopyTo("~/" + preName.SelectedValue + args.FileName);  
    10.         }  
    11.     </script>  
    12. </head>  
    13. <body>  
    14.     <form id="Form1" runat="server">  
    15.         <asp:DropDownList ID="preName" runat="server">  
    16.             <asp:ListItem Value="a3">A3</asp:ListItem>  
    17.             <asp:ListItem Value="a4">A4</asp:ListItem>  
    18.             <asp:ListItem Value="a5">A5</asp:ListItem>  
    19.         </asp:DropDownList>  
    20.         <CuteWebUI:UploadAttachments ID="uploader1" runat="server" OnFileUploaded="uploader1_FileUploaded">  
    21.         </CuteWebUI:UploadAttachments>  
    22.     </form>  
    23. </body>  
    24. </html>  
     

    Regards,

     

    Ken 

View Complete Thread