Hi
I think this may help u
public void ExportTableData(DataTable dtdata)
{
string attach = "attachment;filename=Sample.xls";
Response.ClearContent();
Response.AddHeader("content-disposition", attach);
Response.ContentType = "application/ms-excel";
if (dtdata != null)
{
}
Response.End();
}
}