如何在浏览器上打开excel文件...在asp.net c# [英] how to open excel file on browser ...in asp.net c#

查看:263
本文介绍了如何在浏览器上打开excel文件...在asp.net c#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个excel文件,当用户点击帮助按钮excel文件应该在浏览器上打开...我不知道该怎么做...

解决方案

< blockquote>您只需尝试使用此行:

 Response.AppendHeader(  Content-Disposition  inline; filename = + < span class =code-string>  yourExcelFileName.xls); 



如果然后你可以遵循类似的:

如何使用ASP.NET和二进制文件写入浏览器Visual C#.NET [ ^ ]

在浏览器中打开excel文件 [ ^ ]

C#在Web浏览器中打开.xls文件时会打开一个excel实例 [ ^ ]


将Google Doc Viewer嵌入您自己的网页,以显示任何类型的文档,包括Excel文件。它非常简单易用!在您的网页中添加如下标记代码:



 <   iframe     src   =  http://docs.google.com/gview?url=URL_TO_YOUR_EXCEL_FILE_HERE&embedded=true   样式  =  width:600px; height:500px;    frameborder   =  0 >   <   / iframe  >  


i have a excel file when user click on help button excel file should open on browser ...i don't know how to do this ...

解决方案

Simply you can try with this line:

Response.AppendHeader("Content-Disposition", "inline;filename=" + "yourExcelFileName.xls");


If not then you can follow the similar ones:
How To Write Binary Files to the Browser Using ASP.NET and Visual C# .NET[^]
open excel file in browser[^]
C# when opening a .xls file in the web browser it opens an instance of excel[^]


Embed Google Doc Viewer in your own webpage to display any kind of documents including Excel files. It's very simple to use and free! Add a markup code like the following in your webpage:

<iframe src="http://docs.google.com/gview?url=URL_TO_YOUR_EXCEL_FILE_HERE&embedded=true" style="width:600px; height:500px;" frameborder="0"></iframe>


这篇关于如何在浏览器上打开excel文件...在asp.net c#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆