ComponentOne ToolBar for ASP.NET AJAX: Working With Client-Side Script > Client-Side Events

Client-Side Events

C1Upload includes several client-side events that allow you to manipulate the upload items in the C1Upload control when an action such as adding a file or uploading a file occurs.

You can access these client-side events from the Properties window. To create a new client-side event using the Properties window, select the drop-down arrow next to a client-side event and select Add new client side handler.

Once you've added the client-side handler, Visual Studio will add a script to the Source view. The placeholder will resemble the following:

<script type="text/javascript" id="ComponentOneClientScript1">

function C1Upload1_OnClientRemoved(){

  //

  // Put your code here.

  //

};

Each of the client-side events requires two parameters: the ID that identifies the sender C1Upload, in this example, C1Upload1, and an eventArgs that contains the data of the event.

You can use the sever-side properties, listed in the Client Side Event table, to specify the name of the JavaScript function that will respond to a particular client-side event. For example, to assign a JavaScript function called "ClientRemoved” to respond to the clicked item, you would set the OnClientRemoved property to "ClientRemoved".

The following table lists the events that you can use in your client scripts. These properties are defined on the server side, but the actual events or the name you declare for each JavaScript function are defined on the client side.

Client Side Event table

Event Server-Side Property Name

Event Name

Description

OnClientAdded

ClientAdded

Gets or sets the name of the client-side function which will be executed after a new file input is added to a C1Upload instance.

OnClientAdding

ClientAdding

Gets or sets the name of the client-side function which will be executed before a new file input is added to C1Upload instance.

OnClientError

ClientError

Gets or sets the name of the client-side function which will be executed when the error happens.

OnClientProgressChanged

ProgressChanged

Gets or sets the name of the client-side function which the progress data is changed.

OnClientRemoved

ClientRemoved

Gets or sets the name of the client-side function which will be executed after a file input is deleted from a C1Upload instance.

OnClientRemoving

ClientRemoving

Gets or sets the name of the client-side function which will be executed before a file input is deleted from a C1Upload instance.

OnClientUploadBegin

ClientUploadBegin

Gets or sets the name of the client-side function which will be executed when the upload starts.

OnClientUploadEnd

ClientUploadEnd

Gets or sets the name of the client-side function which will be executed when the upload ends.

 


Send comments about this topic to ComponentOne.
Copyright © 1987-2010 ComponentOne LLC. All rights reserved.