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

Image Browser - DeleteFile Not Working

1 Answer 34 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Aaron
Top achievements
Rank 1
Aaron asked on 14 Feb 2012, 09:25 PM
When I go to the image browser I have a list of images, I want to be able to delete some of the images from within the browser, but it doesn't work.

Adding images and directories works fine.

Thanks

Here is my code,
Html.Telerik().Editor().Name("Editor_" + (String)ViewData["PartId"] + "_" + (String)ViewData["StationId"])
                        .Encode(true)
                        .HtmlAttributes(new { Style = "Height:450px;" })
                        .FileBrowser(b => b.Browse("Browse", "ImageBrowser")
                                           .Thumbnail("Thumbnail", "ImageBrowser")
                                           .Upload("Upload", "ImageBrowser")
                                           .DeleteFile("DeleteFile", "ImageBrowser")
                                           .DeleteFile("DeleteDirectory", "ImageBrowser")
                                           .CreateDirectory("CreateDirectory", "ImageBrowser"))
                        .Value((String)ViewData["Notes"])
                        .Tools(t =>
                        {
                            t.Separator();
                            t.Custom(config => config
                                .Html(
                                    "<input " +
                                    "type='image' " +
                                    "title='Save' " +
                                    "align='bottom' " +
                                    "src='/Content/save.png' "+
                                    "onclick='saveToDatabase(" + (String)ViewData["PartId"] + ", " + (String)ViewData["StationId"] + ")' />"
                                ));
                        })

1 Answer, 1 is accepted

Sort by
0
Petur Subev
Telerik team
answered on 29 Feb 2012, 03:39 PM
Hi Aaron,

As examining your code I noticed that your Delete File action method is declared two times. So The action method which handles the Delete File is actually the DeleteDirectory action.

All the best,
Petur Subev
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 Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now.
Tags
General Discussions
Asked by
Aaron
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
Share this question
or