<script type="text/javascript" language="javascript"> function fileSelecting(e, args) { } </script> <igjq:WebUpload ID="webUpload1" runat="server"> <ClientEvents FileSelecting="fileSelecting"/> </igjq:WebUpload>
The WebUpload control exposes a rich client-side API featuring a number of events. There are seven different client-side events, which are fired either while the user is interacting with the control or during the upload process.
You attach a handler by defining the function name in the ClientEvents tag of the WebUpload. Then, you must create a JavaScript function with the same value to handle the event.
For example consider the fileSelecting event, which is described later in Client Events section of this document.
Inside the attached handler you can implement any necessary logic. For this you can use the attributes of the event, which is named the same for all the events - e for the event, args for the arguments. Depending on the event, the args arguments contains a different set of properties.
Note: Remember that if you want to cancel an event (cancellable events are fileSelecting and fileUploading) you just need to return false from the function.
Table 1: Client events available from the igUpload control
The following tables map the message codes returned from the server with their meanings.
Table 2: Enumeration of type UploadStatus
Table 3: Enumeration of type FileError (for server side error)
Table 4: Enumeration of type FileError (for client side error codes)