Occurs when an exception is thrown during upload process.

Namespace:  EasyAlgo.EAUpload
Assembly:  EasyAlgo.EAUpload (in EasyAlgo.EAUpload.dll)
Version: 1.3.0.0

Syntax

C#
public event EventHandler UploadError
Visual Basic (Declaration)
Public Event UploadError As EventHandler

Remarks

The exception that raises the UploadError event can be accessed by a call to the Upload..::.LastError property. You may use handler of this event to provide user friendly information about upload exception.

Examples

The following example handles the UploadError event and retrieves an exception that had been thrown.
CopyC#
// Global.asax.cs

public class Global : System.Web.HttpApplication
{
    ...

    protected void EAUploadModule_UploadError(Object Source, EventArgs Details)
    {
        Upload _upload = (Upload)Source;

        Session["CurrentUploadError"] = "UploadError: " + _upload.LastError.Message;

        Server.Transfer("ErrorProcessing.aspx");        
    }

    ...

}
CopyVB.NET
' Global.asax.vb


Public Class Global
    Inherits System.Web.HttpApplication

    ...

    Sub EAUploadModule_UploadError(ByRef Source As Object, ByRef Details As EventArgs)

        Dim _upload As Upload = CType(Source, Upload)

        Session("CurrentError") = _upload.LastError.Message
        Server.Transfer("ErrorProcessing.aspx")

    End Sub    

    ...

End Class

See Also