0
請幫忙,我知道這個問題已經被問過,但我沒有得到任何解決方案......我有一個aspx頁面,它必須顯示一些類型爲docx和xlsx的文件......我試圖在google docs viewer中使用iframe,但引發錯誤:無法預覽。下面是我在我的aspx頁面代碼:無法預覽iframe aspx頁面
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<style type="text/css">
body {
margin: 0px;
}
.doc {
border: 0; width: 100%; height: 100%;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div>
<iframe class="doc" src="https://docs.google.com/gview?url=http://localhost:2342/Project-Test-Temp/Uploaded/Save.docx"&embedded=true"></iframe>
</div>
</form>
</body>
</html>
下面是一個工作示例:
我已經試過這樣:
<iframe class="doc" src="../UploadedImages/Save.docx"></iframe>
但它正在下載文件!
如何解決此問題並正常顯示我的word和excel文件?我很欣賞你的幫助