在新窗口中打开文件 [英] open file in new window

查看:105
本文介绍了在新窗口中打开文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有gridview,其中有链接按钮.我想直接打开文件而不保存在当前或新窗口中.目前,当我单击链接按钮时,它会要求我先保存它不想执行的操作.

所以,请回复..
谢谢....
Mitesh

i have gridview in which there is link button. i want to open file directly not save in current or new window. at present when i m click on link button it ask me to save it first that i not want to do.

So,please reply ..
Thanksssss.......
Mitesh

推荐答案

这完全取决于文件的类型,以及客户端是否具有该类型的有效读取器.大多数人都有PDF阅读器,因此它将在默认阅读器中打开.但是,人们可能没有Excel,因此无法在客户端上打开文件,也没有为此类型注册阅读器.
That all depends what type of file it is and if the client has a valid reader for that type. Most people have a PDF reader so it would open in the default reader. However, people may not have Excel so the file can''t be opened on the client, no reader is registered for that type.


如Mark所说,这取决于文件的类型. ,以及是否要在文件的默认处理程序中打开它.
我认为,从我们所掌握的少量信息中,您希望用户在计算机上安装的默认应用程序中查看关联的文件.

您提到了gridview,所以我假设使用Web应用程序.
http://stackoverflow.com/Questions/93832/how-does-one-load-a-url-from-a-net-client-application#93862 [ http://stackoverflow.com/questions/181719/how- to-start-a-process-from-c-sharp-winforms [
As Mark said it depends on the type of the file, and if you want it to open in the default handler of the file.
I assume from the little information we have, you want the user to view the associated files, in a default application installed on the machine.

You mentioned a gridview, so I am assuming a Web Application.
http://stackoverflow.com/questions/93832/how-does-one-load-a-url-from-a-net-client-application#93862[^]

This is using the Process class, which allows you to start a process and run it with a number of arguments.
http://stackoverflow.com/questions/181719/how-to-start-a-process-from-c-sharp-winforms[^]


这篇关于在新窗口中打开文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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