Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
430
OnUploadFinished doesn't work
posted

Hi,

 

I'm trying to get the filename after upload it and put the path in a label using csharp, I used the OnUploadFinished method but it doesn't work.

 

You find below the code that I used.

 

            <asp:Label ID="lblfinished" runat="server"></asp:Label>

 

 

            <ig:WebUpload ID="webUpload1" runat="server"

                OnUploadFinished="webUpload1_OnUploadFinished"

                MaxSimultaneousFilesUploads="1" Mode="Multiple">

 

                    <ClientEvents FileSelecting="fileSelecting" FileSelected="fileSelected"

                        FileUploading="fileUploading" FileUploaded="fileUploaded"

                        FileUploadAborted="fileUploadAborted" CancelAllClicked="cancelAllClicked"

                        OnError="onError"/>

            </ig:WebUpload>

 

CSharp


 

    protected void webUpload1_OnUploadFinished(object sender, UploadFinishedEventArgs e)

    {

        string filePath = String.Format("{0}{1}", e.FolderPath, e.FileName);

        lblfinished.Text = "Name: " + filePath;

    }

 

 

 

 

The code works correctly, only the method doesn't work.

Thank you

 

Parents
  • 1800
    posted

    Hi heni84,

    You should update label using client side code. My advice is to bind to client side event fileUploaded and when the file is uploaded to populate the value of the label.

    The problem is caused because event fileUploaded is fired after the page is requested and there is no additional request to populate value of the label.

    Thanks,

    Miro Hristov

Reply Children
No Data