How to delete correct file using a custom handler

5 posts, 0 answers
  1. Dwayne
    Dwayne avatar
    41 posts
    Member since:
    Jun 2009

    Posted 16 May 2011 Link to this post

    I am using q2 2010. I am using the radasyn control to upload files. The Issue I am having is I can't tell which file to delete and remove. Say I have 5 files uploaded and want to remove one, since I uploaded all the files to the DB I need to delete the fiel from the DB as well as the client screen. I can'''t seen to find a way to achieve both options. I can delete from the client screen but can delete from the db becasue I can't tell which file is being deleted. I can only get the index of the file. I have searched for some documentation on the onclientdeleteing eventargs but it is no longer used by the newer version . Do you have any suggestions. I have all the id for the files uploaded and associated with each image as the image id but I can't tell which file is being deleted. Thanks in advance
  2. Peter Filipov
    Admin
    Peter Filipov avatar
    1028 posts

    Posted 19 May 2011 Link to this post

    Hi Dwayne,

    When remove a file, OnClientFileUploadRemoving event is fired. get_fileName() form the event arguments returns the file name.
    Another suggestion is to upload files to the DB after the postback.
    FileUploaded event occurs server-side for every file which is going to be processed.

    Kind regards,
    Peter Filipov
    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.

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Dwayne
    Dwayne avatar
    41 posts
    Member since:
    Jun 2009

    Posted 19 May 2011 Link to this post

    Thanks for the reply. I think I will use that suggestion. What I will do is append the id to the file name and use that as the image id so when I am deleting the file with a delete handler I have created i will know which file to delete. All the  files I am deleting and uploading are on the client using handlers so a post back doesn't occur. and I notice that if a post back happens the image is removed so you don't can't see the pictures anymore.  Thanks again  for the suggestion.
  5. David
    David avatar
    5 posts
    Member since:
    May 2005

    Posted 29 Mar 2012 Link to this post

    I have a similar issue. I would just like to get rid of the Remove option so the user never even has the option to remove a file when using the RadAsyncUpload control. Is there an option to hide the x Remove button associated with the uploaded file after it has been uploaded? Thanks for any suggestions.
  6. Peter Filipov
    Admin
    Peter Filipov avatar
    1028 posts

    Posted 03 Apr 2012 Link to this post

    Hi David,

    Regarding your enquiry you can use CSS to hide the Remove button. Please add the following style to change the RadAsyncUpload appearance:
    .ruRemove
    {
        display:none !important;
    }


    All the best,
    Peter Filipov
    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.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017