protected void lnkFile_Click(object sender, EventArgs e)
{
// Create path to xls file
string path = (this.Master as Site).GetDataDir() + "\\Miscellaneous\\";
// Set filename
string fileName = "PivotTable.xls";
// Sents the file to browser.
Response.ContentType = "application/vnd.ms-excel";
Response.AddHeader("content-disposition", "attachment; filename=" + fileName);
Response.WriteFile(path + fileName);
Response.End();
}
}