This is a migrated thread and some comments may be shown as answers.

Log actions

4 Answers 70 Views
FileExplorer
This is a migrated thread and some comments may be shown as answers.
Mazdak
Top achievements
Rank 1
Mazdak asked on 09 Jan 2011, 12:23 PM
I want to log user actions in FileExplorer , for example there when user delete a file, I insert a log record into my database but I can not see any server side event for this. Is there any trick for doing this?


Regards
Mazdak

4 Answers, 1 is accepted

Sort by
0
Accepted
Dobromir
Telerik team
answered on 12 Jan 2011, 01:51 PM
Hi Mazdak,

RadFileExplorer offers two server-side events - ItemCommand and ExplorerPopulated. To achieve the required functionality you can use the ItemCommand event, e.g.:
protected void RadFileExplorer1_ItemCommand(object sender, RadFileExplorerEventArgs e)
{
   switch (e.Command)
   {
       case "UploadFile":
           break;
       case "MoveDirectory":
           break;
       case "CreateDirectory":
           break;
       case "DeleteDirectory":
           break;
       case "DeleteFile":
           break;
       case "MoveFile":
           break;
   }
   // e.Cancel = true; // Cancel the operation
}


More detailed information regarding the server-side events is available in the following help article:
Server-Side programming

Greetings,
Dobromir
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
Mazdak
Top achievements
Rank 1
answered on 12 Jan 2011, 02:09 PM
Hi,

Thanks for reply, I found this out myself but as a suggestion:

This event fires before action happen , that be nice if FileExplorer has an event which fires after action too which inform success and failiur too.

Thanks
Mazdak
0
Terri-Lynn
Top achievements
Rank 1
answered on 01 Nov 2011, 07:02 PM
I have a quick question on this one:  I have the e.Command = "UploadFile" working like a charm.  Inside this I do a... For Each uploadedFile As UploadedFile In upload.UpladedFiles.  I need to duplicate this sort of action in the e.Command = "DeleteFile".  Since a user can delete multiple files at once, I want to log who's doing that.  Help please!  :)
0
Dobromir
Telerik team
answered on 04 Nov 2011, 10:24 AM
Hi Terri-Lynn,

In case of multiple file Upload / Delete the ItemCommand event is fired for each item and you can use the event argument's Path property to get the path to the file, e.g.:
protected void rfeFiles_ItemCommand(object sender, RadFileExplorerEventArgs e)
{
    if (e.Command == "DeleteFile")
    {
        string file = e.Path;
         
        //add logging logic
    }
}


Kind regards,
Dobromir
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Tags
FileExplorer
Asked by
Mazdak
Top achievements
Rank 1
Answers by
Dobromir
Telerik team
Mazdak
Top achievements
Rank 1
Terri-Lynn
Top achievements
Rank 1
Share this question
or