Click here to Skip to main content
15,886,864 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
This is my code.
C#
protected void gdvfile_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "Download")
            {
                var a = e.CommandArgument.ToString();
                string filename = a;
                Response.AppendHeader("Content-Disposition","attachment;filename=" + filename);
                string aaa = Server.MapPath("~/Upload/" + filename);
                Response.TransmitFile(Server.MapPath("~/Upload/" + filename));
                Response.End();
            }
        }
Posted

1 solution

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