ms Office文件应在asp.net页的内联中显示 [英] ms office files should display in inline of asp.net pages
问题描述
我在显示图像的网格视图中.onclick图像将打开内容文件.它可能很快就是pdf,.docx,excel,png MS-Acccess文件...就我而言,所有pdf和vedio,图像以内联方式显示,但ms-office文件未以内联方式显示..对于ms-office文件,它正在打开弹出窗口,显示打开,保存,另存为..如果单击打开",则是在Word文档中打开...但是我不想要这种...我想在asp.net页面上显示pdf和图像文件,任何人都可以帮助我解决这个问题..
我的代码就像
Response.AddHeader("content-disposition","inline; FileName" = Request.Params ["PP"].ToString());
Response.ContentType = contentType;
Response.WriteFile(Request.Params ["PP"].ToString());
Response.End();
i have grid view in that am displaying image..onclick image it will open content files..it may be pdf,.docx,excel,png MS-Acccess files soon...in my case all pdf and vedio,images are displaying in inline but ms-office files are not displaying in inline..for ms-office files it is opening popup window showing that open,save,save as..if u click open it is opening in word document...but i dn''t want this kind...i wanted to display in asp.net page like pdf and image files can anyone help me about this plz..
my code is something like
Response.AddHeader("content-disposition","inline; FileName"= Request.Params["PP"].ToString());
Response.ContentType = contentType;
Response.WriteFile(Request.Params["PP"].ToString());
Response.End();
推荐答案
将超链接的target
属性设置为_parent
.
这应该在同一窗口中打开链接.
Settarget
property of the hyperlink to_parent
.
This should open the link in the same window.
在"C:\ Windows \ SysWOW64 \ config \ systemprofile \"中创建一个新的"Desktop"目录.对象null引用异常...桌面文件夹将存储临时文件...请参考以下URL
http://social.msdn.microsoft.com/论坛/en-US/architecturegeneral/thread/0f5448a7-72ed-4f16-8b87-922b71892e07 [
Create a new "Desktop" directory inside of "C:\Windows\SysWOW64\config\systemprofile\"..then it will not show object null reference exception...Desktop folder will store temporary files...refer the following URL
http://social.msdn.microsoft.com/Forums/en-US/architecturegeneral/thread/0f5448a7-72ed-4f16-8b87-922b71892e07[^]
嗨
一次检查此链接即可在网页本身中显示MS文档.
单击此处
最好的
Hi
Check this link once to display MS documents in web page itself
click here
All the Best
这篇关于ms Office文件应在asp.net页的内联中显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!