Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
3.7k views
in .NET FTP by (520 points)
I'm not sure I understand the order of events.

I have "PromptOnDelete" set to true. I'm also listening to the the "DeletingFile" event. When I right click on a file listed on the FTPRemoteFileList control and select "Delete", the "DeletingFile" event fire before I am prompted. It seems to me that I should be prompted first and if I select "No" then the DeletingFile event should fire.

Since this does not seem to be the case, how do I prompt the user as to whether or not they want to delete a file, but still be able to do some actions before the files are deleted?

3 Answers

0 votes
by (51.6k points)
Hi Shawn

The reason the DeletingFile event is triggered before the prompt is that it permits the developer to exclude certain files before the user gets prompted. To do what you want I suggest that you set PromptOnDelete to false and then do your own prompting inside the DeletingFile handler.

Just out of interest, what is it you want to do after the prompt?

- Hans (EnterpriseDT)
0 votes
by (520 points)
Actually I wanted to do some database cleanup before deleting the file. What I ended up doing is doing the db cleanup after the file is deleted. I'd rather do the cleanup first, but doing it last should be ok.

The problem with promting inside the DeletingFiles event handler is if there is more than one file selected. The user would be prompted for each file. I guess that is ok though as I could create a message box with an "apply to all" check box.

Thanks for your help though. This is a great product!
0 votes
by (51.6k points)
Yes, we really should have an "Apply to all" option in our prompt as well.

- Hans (EnterpriseDT)

Categories

...