Click here to Skip to main content
15,887,596 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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...
C#
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();
            }
    }

can any one help me
thanks in advance..
plzzzz help meeeeeee
Posted
Updated 3-Jan-12 0:10am
v3

 
Share this answer
 
VB
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>";
 
Share this answer
 
Comments
Ragi Gopi 4-Jan-12 4:12am    
Rakesh meal

i want to display doc file only in click event of bulleted list

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900