.

download Button

protected void downloadButton_Click(object sender, EventArgs e)
    {
        string fileName = "test.xls";
        string filePath = Server.MapPath("~/test.xls");
        Response.Clear();

        Response.AppendHeader("content-disposition", "attachment; filename=" + fileName);
        Response.ContentType = "application/octet-stream";
        Response.WriteFile(filePath);
        Response.Flush();
        Response.End();
    }

What's your thoughts on this?

*

Protected by WP Anti Spam