protected void Button1_Click(object
sender, EventArgs e)
{
string attachment = "attachment;
filename=filename.xls";
Response.ClearContent();
Response.AddHeader("content-disposition",
attachment);
Response.ContentType = "application/ms-excel";
}