title: Opening Excel file from Server aspx
body: <p>I have the following X.aspx  code..to download excel file from Server</p>
  
  <pre><code>if (ss[5] != "")
              {
                  Response.Clear();
                  Response.AddHeader("Content-disposisition", "inline;filename=x.xls");
                  Response.ContentType = "application/vnd.ms-excel";
                  Response.TransmitFile(ss[5]);
                  Response.End();
              }
  </code></pre>
  
  <p>Excel throws message</p>
  
  <p>The file you are trying to open 'x.aspx', is in a different format that specified by the file extention....</p>
  
  <p>How can I let excel know the correct file name ..</p>