我使用C#在asp.net中開發了一個響應式網站,它在桌面和手機中都可以正常工作,所有功能性工作都很好。諾基亞Lumia 920 Excel未打開
但是在諾基亞Lumia 920上,當我下載Excel時,它被下載了,但是沒有在手機中打開。它拋出錯誤,如 格式不正確
我已經使用了下文提到的代碼下載Excel的
Response.AddHeader("content-disposition", "attachment;filename=" + ExcelFileName + ".xlsx");
Response.Charset = "";
Response.ContentType = "application/vnd.ms-excel";
StringBuilder build = new StringBuilder();
//buid contain data
Response.Output.Write(build.ToString());
Response.Flush();
Response.End();
什麼可以解決?
嘗試改變的ContentType爲「application/vnd.openxmlformats-officedocument.spreadsheetml.sheet 「。另外,你確定你需要這個標題「內容處置」嗎?通常這是電子郵件附件 – 2014-09-02 10:27:33
@StefanoDriussi:Nop它仍然給我同樣的錯誤 – 2014-09-02 10:38:48