ComponentOne ToolBar for ASP.NET AJAX: Upload for ASP.NET AJAX Task-Based Help > Client-Side Tasks > Getting the File Name at Client Side

Getting the File Name at Client Side

You can get the file name at client side in the event args of client side for the OnClientAdding, OnClientAdded, OnClientRemoving, and OnClientRemoved events.

The following example uses the OnClientAdding event to get the file name at the client side when a new row is being added to the C1Upload control.

 

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

        function C1Upload1_OnClientAdding(sender, args) {

            alert(args.get_fileName() + " is adding");

};

</script>

 

The following example uses the OnClientRemoving event to get the file name at the client side when a row is removed in reponse to the close button:

 

</script>

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

        function C1Upload1_OnClientRemoving(sender, args) {

            alert(args.get_fileName() + " is removing");

};

<cc1:C1Upload ID="C1Upload1" runat="server" MaximumFiles=5

            onclientadding="C1Upload1_OnClientAdding" Width="250px"

            onclientremoving="C1Upload1_OnClientRemoving" />

 


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