Reputation: 5436
FireFox Shows Pop up for open or Save Dialog.
<iframe id="appFrame" runat="server" style="height: 95%; width: 100%; border: 0px;
z-index: -123;"></iframe>
I am using iframe to display word document,
document.getElementById("ctl00_GridContentPlaceHolder_appFrame").src = "ResponseWriter.aspx?docid=" + docId + "&doctype=" + docType + "&type=" + type;
I am calling ResponseWriter.aspx to write bytes it works well in IE but not in Firefox,Here is the code of ResponseWriter.aspx
Response.ClearHeaders();
Response.ClearContent();
Response.AddHeader("MIME Type", type.Trim());
Response.AppendHeader("content-disposition",
"inline;attachment; filename=" + "Unknown." + docType);
Response.AddHeader("Content-Length", _fileArray.Length.ToString());
Response.Cache.SetCacheability(System.Web.HttpCacheability.NoCache);
Response.ContentType = type.Trim();
Response.BinaryWrite(_fileArray.ToArray());
Response.End();
Can any one please help me.
Upvotes: 1
Views: 617
Reputation: 26956
This is probably because Office has installed some hooks into IE to support "in browser" viewing of Office documents, while Firefox, Chrome, etc. just send the bytes to the Office application.
Without seeing more details of the way "ResponseWriter.aspx" is sending the bytes to the stream and what behaviour you're seeing in Firefox, there's not much more I can guess at the moment.
As a point of note, you should probably look into using a request handler (.ashx) instead of the .aspx page - this has a cleaner model for these sorts of requests as it doesn't use most of the page life-cycle.
Upvotes: 2