Re: Change MultipleFilesUpload on-the-fly

  •  06-30-2011, 10:16 AM

    Re: Change MultipleFilesUpload on-the-fly

    Hi smcleod,
     
    Please use server side code to set this:

    <%@ Page Language="C#" %>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "

    <script

    runat="server">
        static int i = 0;
        void InsertMsg(string msg)
        {
            ListBoxEvents.Items.Insert(0, msg);
            ListBoxEvents.SelectedIndex = 0;
        }

        void ButtonMultiple_Click(object sender, EventArgs e)
        {
            if(i%2==0)
            {    
                Attachments1.MultipleFilesUpload=true;
            }
            else
            {
                Attachments1.MultipleFilesUpload=false;
            }
            i += 1;
        }
      
    </script>

    <html xmlns="http://www.w3.org/1999/xhtml">
    <head id="Head1" runat="server">
        <title>Uploading multiple files</title> 
    </head>
    <body>
        <form id="form1" runat="server">
            <div class="content">                       
                    <div>
                        <CuteWebUI:UploadAttachments runat="server" ID="Attachments1" MultipleFilesUpload=false>
                        </CuteWebUI:UploadAttachments>
                    </div>
                         <br />         
                <asp:Button ID="ButtonMultiple" runat="server" Text="Single/Multiple Files Upload Switch"
                    OnClick="ButtonMultiple_Click" />        
                <div>
                    Server Trace:
                    <br />
                    <asp:ListBox runat="server" ID="ListBoxEvents" Width="400"></asp:ListBox>
                </div>
            </div>
        </form>
    </body>
    </html>

    Thanks for asking
View Complete Thread