Click here to Skip to main content
15,909,445 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
hi to all.,

i have a problem with ASP .Net Datalist that to download multiple files in single click.

In a datalist i putted a checkbox and if i click on Download then which files are Checked in datalist those files only should get download.

Thanks..
Posted


code for download multiple file in single click in datalist


XML
<asp:Button runat="server" ID="btn1" OnClick="btn1_Click" Text="DownLoad Multiple Files" />
    <asp:Repeater runat="server" ID="rptr">
        <ItemTemplate>
            <iframe src="<%#Container.DataItem%>"></iframe>
        </ItemTemplate>
    </asp:Repeater>


C#
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Collections.Generic;
public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void btn1_Click(object sender, EventArgs e)
    {
        List<string> files = new List<string>();
        files.Add("data1.zip");
        files.Add("data2.zip");
        files.Add("data3.zip");
        files.Add("data4.zip");
        rptr.DataSource = files;
        rptr.DataBind();
    }



It may also help you. click here

 
Share this answer
 
v2
At the click, you need to get the selected files, zip them, and push to client.

http://stackoverflow.com/questions/2670263/asp-net-download-all-files-as-zip[^]
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900