IZWebFileManager

Advanced ASP.NET File Manager
Welcome to IZWebFileManager Sign in | Join | Help
in Search
The forum is moved to http://groups.google.com/group/izwebfilemanager
If you have any question, please post there. Thanks!

Download from an ASP Button

Last post 06-24-2010, 1:39 AM by MarkJ. 4 replies.
Sort Posts: Previous Next
  •  06-22-2010, 5:40 AM 525

    Download from an ASP Button

    In the Opera and Chrome browsers the right click menu does not work.

    I would like to provide a Download ASP button to download a selected file.

    How can I call the download from an ASP button?
  •  06-23-2010, 10:04 AM 528 in reply to 525

    Re: Download from an ASP Button

    use SelectedItems property

    for example, put your button on the page and handle it's click event:

    void Button1_Click(object sender, EventArgs e)
    {
        var selectedItems =  FileManager1.SelectedItems;
       // response with download stream here
    }
  •  06-23-2010, 11:36 AM 529 in reply to 528

    Re: Download from an ASP Button

    Thanks Igor,

    However I actually wanted to call file managers download as in the right click menu.

    This is so I can place code in the file manager download event.

    Regards Mark.
  •  06-23-2010, 1:36 PM 531 in reply to 529

    Re: Download from an ASP Button

    put asp HyperLink on the page

    <asp:HyperLink runat="server" ID="DownloadLink" Text="Download"></asp:HyperLink>

    in code behind set it's NavigationUrl:

    DownloadLink.NavigateUrl = "javascript:WFM_" + FileManager1.Controller.ClientID + ".OnExecuteCommand(WFM_" +
                                    FileManager1.ClientID + "_FileView, '0:-2');void(0);";
  •  06-24-2010, 1:39 AM 533 in reply to 531

    Re: Download from an ASP Button

    Thanks Igor,

    That works very well.

    Regards ..... Mark
View as RSS news feed in XML
www.IZWebFileManager.com
izwebfilemanager@gmail.com