Posted on: 1/31/2014 4:21:00 AM | Views : 676

Hi,
We are using asp.net 2.0 with C#. Initially we had requirement to open PDF files in browser. We are storing pdf files in database blob field. Retrieving pdf from database and converting it into byte[]. Then we display like this:
byte[] dt = //getting pdf file from database
Response.Clear();  Response.ClearContent();  Response.ClearHeaders();
 Response.ContentType = "application/pdf";  Response.AppendHeader("Content-Disposition", "inline; filename=\"" + FileName + "\"");  Response.BinaryWrite(dt);  Response.Flush();  Response.Close();
This is working fine and pdf opens in both IE and FF. Now user added excel files to database want to display them in IE and FF browser like PDF. I tried the code in different ways. But always it opens up  dialog to open in excel rather than in browser. The following are various op ...

Go to the complete details ...