如何在iframe中打开Word文件 [英] how to open a word file in iframe

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

问题描述

大家好

我试图在iframe中打开Word文件...
但它不起作用...任何人都可以帮助我..
iframe中显示错误....
从Visual Studio运行时,错误为

hi all

i tried to open a word file in a iframe...
but its not working...can any one help me..
An error is showing in the iframe....
when running from visual studio the error is as

Server Error in '/Virtual_Office_KFRI' Application.

The resource cannot be found.

Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable.  Please review the following URL and make sure that it is spelled correctly. 

Requested URL: /Virtual_Office_KFRI/KFRI_Procedures/20011-1=Equips-Purchase-Procedure.doc

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1


我的代码在下面...


my code is below...

protected void bl_procedures_Click(object sender, BulletedListEventArgs e)
    {
        try
        {
            string path = Server.MapPath("PROCEDURES/" + bl_procedures.Items[e.Index].Text);
            System.IO.FileInfo file = new System.IO.FileInfo(path);
            Label2.Text = file.Name +"###" + file.FullName;
            //Response.Clear();
            //Response.AddHeader("Content-Disposition", "inline; filename=" + file.Name);

            //Response.AddHeader("content-length", file.Length.ToString());
            //Response.ContentType = ReturnExtension(file.Length.ToString());
            //Response.TransmitFile(file.FullName);
            //Response.WriteFile(file.FullName);
            //Response.End();

            frmWord.Attributes["src"] = file.Name;
        }
            catch(Exception ex)
            {
                Label2.Text = ex.ToString();
            }
    }


谁能帮我
在此先感谢..
plzzzz help meeeeeee


can any one help me
thanks in advance..
plzzzz help meeeeeee

推荐答案

嗨Ragi Gopi,
使用以下链接获得一定的帮助;
http://www.eggheadcafe.com/community/asp-net/17/10136951/display-word-document-in-aspnet-control.aspx [
Hi Ragi Gopi,
Use following link to get some assured help;
http://www.eggheadcafe.com/community/asp-net/17/10136951/display-word-document-in-aspnet-control.aspx[^]


string officeDocScript = "<div>"
 "<iframe width=\"75%\" height=\"55%\" name=\"fframe\" src=\"" + filePath
 "\">"
 "<frame width=\"75%\" height=\"55%\" name=\"fframe\" src=\"" + filePath
 "\">"
 "<embed src=\"" + filePath +  "\">"
 "</iframe></div>";


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

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