Re: manual upload in code behind

  •  10-11-2011, 10:35 AM

    Re: manual upload in code behind

    Hi jerrysax,
     
    please try the example below, it shows you how to get the upload files data by a button
     
    <%@ Page Language="VB" %>

    <%@ Register Assembly="CuteWebUI.AjaxUploader" Namespace="CuteWebUI" TagPrefix="CuteWebUI" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <script runat="server">
       
        Protected Sub button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
            For i As Integer = 0 To uploader1.Items.Count - 1
                label1.Text += "File Name: " + uploader1.Items(i).FileName
                label1.Text += "<br />"
                label1.Text += "File Szie: " + uploader1.Items(i).FileSize.ToString()
                label1.Text += "<br />"
            Next

        End Sub
    </script>

    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Untitled Page</title>
    </head>
    <body>
        <form id="form1" runat="server">
            <div>
                <CuteWebUI:UploadAttachments ID="uploader1" runat="server">
                </CuteWebUI:UploadAttachments>
                <asp:Button ID="button1" runat="server" Text="get upload files" OnClick="button1_Click" /><br />
                <asp:Label ID="label1" runat="server"></asp:Label>
            </div>
        </form>
    </body>
    </html>
     
    Regards,
     
    Ken
View Complete Thread