Server has Microsoft Office 2003. Code is as below

at aspx Page

```
<asp:UpdatePanel ID="UpdatePanel2" runat="server">
  <ContentTemplate>
    <asp:LinkButton ID="ExportExcel" runat="server" OnClick="ExportTabletoExcel_Click" OnClientClick="ExportTableJqueryMethod">ExportExcel</asp:LinkButton>
 </ContentTemplate>
  <Triggers>
    <asp:PostBackTrigger ControlID="ExportExcel" />
  </Triggers>
</asp:UpdatePanel>

```

At Code behind

```
using Excel1= Microsoft.Office.Interop.Excel;
...
protected void ExportTabletoExcel_Click(object sender, EventArgs e)
{
Excel1.Application excelApp = new Excel1.Application();
...//Adding Data to Excel
excelWorkBook.SaveAs(path, Excel1.XlFileFormat.xlWorkbookNormal);
excelWorkBook.Close();

...//to download
HttpContext.Current.Response.ContentType = "application/xls";
HttpContext.Current.Response.AppendHeader("content-disposition", "attachment; > filename=ExportedExcel.xls");
HttpContext.Current.Response.WriteFile(path + ".xls");
}

```

In Web.config
`<add assembly="Microsoft.Office.Interop.Excel, Version=11.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"/>`

on click in Visual Studio the excel downloads just fine. But while running the same on server refreshes the page and no excel downloads.